forked from mirrors/jj
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.
This commit is contained in:
parent
77c811163f
commit
c197add39b
1 changed files with 11 additions and 8 deletions
|
@ -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 {
|
fn gix_open_opts_from_settings(settings: &UserSettings) -> gix::open::Options {
|
||||||
let user_name = settings.user_name();
|
let user_name = settings.user_name();
|
||||||
let user_email = settings.user_email();
|
let user_email = settings.user_email();
|
||||||
gix::open::Options::default().config_overrides([
|
gix::open::Options::default()
|
||||||
// Committer has to be configured to record reflog. Author isn't
|
.config_overrides([
|
||||||
// needed, but let's copy the same values.
|
// Committer has to be configured to record reflog. Author isn't
|
||||||
format!("author.name={user_name}"),
|
// needed, but let's copy the same values.
|
||||||
format!("author.email={user_email}"),
|
format!("author.name={user_name}"),
|
||||||
format!("committer.name={user_name}"),
|
format!("author.email={user_email}"),
|
||||||
format!("committer.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(
|
fn commit_from_git_without_root_parent(
|
||||||
|
|
Loading…
Reference in a new issue