diff options
author | Sebastian Thiel | 2023-04-27 05:38:07 +0000 |
---|---|---|
committer | GitHub | 2023-04-27 05:38:07 +0000 |
commit | 222be0f1e769177241eb2d8d8dfb0de42e450820 (patch) | |
tree | 8e124f3bd373a6abc81b8dec8c1716c894e51d3f /helix-vcs | |
parent | 6dd5054da46fd68993d386de75bfc65130dc2c3b (diff) |
upgrade gitoxide to v0.44 and change repository discovery to worktree-only (#6867) (#6890)
Diffstat (limited to 'helix-vcs')
-rw-r--r-- | helix-vcs/Cargo.toml | 2 | ||||
-rw-r--r-- | helix-vcs/src/git.rs | 27 |
2 files changed, 17 insertions, 12 deletions
diff --git a/helix-vcs/Cargo.toml b/helix-vcs/Cargo.toml index 8a226a0b..978af398 100644 --- a/helix-vcs/Cargo.toml +++ b/helix-vcs/Cargo.toml @@ -17,7 +17,7 @@ tokio = { version = "1", features = ["rt", "rt-multi-thread", "time", "sync", "p parking_lot = "0.12" arc-swap = { version = "1.6.0" } -gix = { version = "0.43.0", default-features = false , optional = true } +gix = { version = "0.44.0", default-features = false , optional = true } imara-diff = "0.1.5" anyhow = "1" diff --git a/helix-vcs/src/git.rs b/helix-vcs/src/git.rs index 00a2c596..cd28d5e4 100644 --- a/helix-vcs/src/git.rs +++ b/helix-vcs/src/git.rs @@ -23,7 +23,7 @@ impl Git { // This path depends on the install location of git and therefore requires some overhead to lookup // This is basically only used on windows and has some overhead hence it's disabled on other platforms. // `gitoxide` doesn't use this as default - let config = gix::permissions::Config { + let config = gix::open::permissions::Config { system: true, git: true, user: true, @@ -32,19 +32,24 @@ impl Git { git_binary: cfg!(windows), }; // change options for config permissions without touching anything else - git_open_opts_map.reduced = git_open_opts_map.reduced.permissions(gix::Permissions { + git_open_opts_map.reduced = git_open_opts_map + .reduced + .permissions(gix::open::Permissions { + config, + ..gix::open::Permissions::default_for_level(gix::sec::Trust::Reduced) + }); + git_open_opts_map.full = git_open_opts_map.full.permissions(gix::open::Permissions { config, - ..gix::Permissions::default_for_level(gix::sec::Trust::Reduced) - }); - git_open_opts_map.full = git_open_opts_map.full.permissions(gix::Permissions { - config, - ..gix::Permissions::default_for_level(gix::sec::Trust::Full) + ..gix::open::Permissions::default_for_level(gix::sec::Trust::Full) }); - let mut open_options = gix::discover::upwards::Options::default(); - if let Some(ceiling_dir) = ceiling_dir { - open_options.ceiling_dirs = vec![ceiling_dir.to_owned()]; - } + let open_options = gix::discover::upwards::Options { + ceiling_dirs: ceiling_dir + .map(|dir| vec![dir.to_owned()]) + .unwrap_or_default(), + dot_git_only: true, + ..Default::default() + }; let res = ThreadSafeRepository::discover_with_environment_overrides_opts( path, |