From c197add39bd96601e4707d9f80ab00d61dffb9de Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 5 Dec 2023 18:27:42 +0900 Subject: [PATCH] git_backend: do not try to resolve git_target path as working directory path The git_target path is normalized and managed by jj, so we don't need a fallback mechanism. Let's make it stricter. --- lib/src/git_backend.rs | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) diff --git a/lib/src/git_backend.rs b/lib/src/git_backend.rs index 60f3c245aa..f972036f43 100644 --- a/lib/src/git_backend.rs +++ b/lib/src/git_backend.rs @@ -385,14 +385,17 @@ pub fn canonicalize_git_repo_path(path: &Path) -> io::Result { fn gix_open_opts_from_settings(settings: &UserSettings) -> gix::open::Options { let user_name = settings.user_name(); let user_email = settings.user_email(); - gix::open::Options::default().config_overrides([ - // Committer has to be configured to record reflog. Author isn't - // needed, but let's copy the same values. - format!("author.name={user_name}"), - format!("author.email={user_email}"), - format!("committer.name={user_name}"), - format!("committer.email={user_email}"), - ]) + gix::open::Options::default() + .config_overrides([ + // Committer has to be configured to record reflog. Author isn't + // needed, but let's copy the same values. + format!("author.name={user_name}"), + format!("author.email={user_email}"), + format!("committer.name={user_name}"), + format!("committer.email={user_email}"), + ]) + // The git_target path should point the repository, not the working directory. + .open_path_as_is(true) } fn commit_from_git_without_root_parent(