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)
| 26 | // relative to `path`, given that `path` is either absolute or is |
| 27 | // relative to the current directory. |
| 28 | func 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. |