MCPcopy
hub / github.com/github/git-sizer / smartJoin

Function smartJoin

git/git.go:28–33  ·  view source on GitHub ↗

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.

(path, relPath string)

Source from the content-addressed store, hash-verified

26// relative to `path`, given that `path` is either absolute or is
27// relative to the current directory.
28func smartJoin(path, relPath string) string {
29 if filepath.IsAbs(relPath) {
30 return relPath
31 }
32 return filepath.Join(path, relPath)
33}
34
35// NewRepository creates a new repository object that can be used for
36// running `git` commands within that repository.

Callers 1

NewRepositoryFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected