Allow nested worktree directories

This commit is contained in:
2021-12-23 18:33:14 +01:00
parent 92e4856dd9
commit 61a8d63374
4 changed files with 61 additions and 5 deletions

View File

@@ -362,8 +362,10 @@ impl Repo {
self.0.config().map_err(convert_libgit2_error)
}
pub fn find_worktree(&self, name: &str) -> Result<(), String> {
self.0.find_worktree(name).map_err(convert_libgit2_error)?;
pub fn find_worktree(&self, path: &Path) -> Result<(), String> {
self.0
.find_worktree(path.to_str().expect("Worktree path is not valid utf-8"))
.map_err(convert_libgit2_error)?;
Ok(())
}