Skip to content

Commit 51cf26b

Browse files
committed
smartJoin(): improve docstring
1 parent 39102df commit 51cf26b

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

git/git.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,10 @@ type Repository struct {
2626
gitBin string
2727
}
2828

29-
// smartJoin returns the path that can be described as `relPath`
30-
// relative to `path`, given that `path` is either absolute or is
31-
// relative to the current directory.
29+
// smartJoin returns `relPath` if it is an absolute path. If not, it
30+
// assumes that `relPath` is relative to `path`, so it joins them
31+
// together and returns the result. In that case, if `path` itself is
32+
// relative, then the return value is also relative.
3233
func smartJoin(path, relPath string) string {
3334
if filepath.IsAbs(relPath) {
3435
return relPath

0 commit comments

Comments
 (0)