Skip to content

Commit

Permalink
smartJoin(): improve docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
mhagger committed Dec 14, 2023
1 parent 39102df commit 51cf26b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,10 @@ type Repository struct {
gitBin string
}

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

0 comments on commit 51cf26b

Please sign in to comment.