Open the containing repo, or initialize one at `root` if no ancestor is a repo.
(root: &Path)
| 67 | |
| 68 | /// Open the containing repo, or initialize one at `root` if no ancestor is a repo. |
| 69 | fn open_or_init(root: &Path) -> Result<Repository> { |
| 70 | open(root).or_else(|_| { |
| 71 | Repository::init(root).with_context(|| format!("git init at {}", root.display())) |
| 72 | }) |
| 73 | } |
| 74 | |
| 75 | /// Path inside the repo's working tree that points at `root`. Used to scope |
| 76 | /// `add_all` pathspec and to translate caller-supplied "trace-relative" |
no test coverage detected
searching dependent graphs…