Skip to content

Commit

Permalink
git_backend: do not try to resolve git_target path as working directo…
Browse files Browse the repository at this point in the history
…ry path

The git_target path is normalized and managed by jj, so we don't need a
fallback mechanism. Let's make it stricter.
  • Loading branch information
yuja committed Dec 6, 2023
1 parent 77c8111 commit c197add
Showing 1 changed file with 11 additions and 8 deletions.
19 changes: 11 additions & 8 deletions lib/src/git_backend.rs
Original file line number Diff line number Diff line change
Expand Up @@ -385,14 +385,17 @@ pub fn canonicalize_git_repo_path(path: &Path) -> io::Result<PathBuf> {
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(
Expand Down

0 comments on commit c197add

Please sign in to comment.