aboutsummaryrefslogtreecommitdiff
path: root/helix-vcs/src
diff options
context:
space:
mode:
authorSebastian Thiel2023-04-27 05:38:07 +0000
committerGitHub2023-04-27 05:38:07 +0000
commit222be0f1e769177241eb2d8d8dfb0de42e450820 (patch)
tree8e124f3bd373a6abc81b8dec8c1716c894e51d3f /helix-vcs/src
parent6dd5054da46fd68993d386de75bfc65130dc2c3b (diff)
upgrade gitoxide to v0.44 and change repository discovery to worktree-only (#6867) (#6890)
Diffstat (limited to 'helix-vcs/src')
-rw-r--r--helix-vcs/src/git.rs27
1 files changed, 16 insertions, 11 deletions
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,