Skip to content

Commit

Permalink
nit: remove unused ceiling_dir param
Browse files Browse the repository at this point in the history
  • Loading branch information
poliorcetics authored and Chirikumbrah committed Jun 15, 2024
1 parent 9786f9e commit dd47ed1
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions helix-vcs/src/git.rs
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ pub fn get_diff_base(file: &Path) -> Result<Vec<u8>> {
// TODO cache repository lookup

let repo_dir = file.parent().context("file has no parent directory")?;
let repo = open_repo(repo_dir, None)
let repo = open_repo(repo_dir)
.context("failed to open git repo")?
.to_thread_local();
let head = repo.head_commit()?;
Expand Down Expand Up @@ -57,7 +57,7 @@ pub fn get_current_head_name(file: &Path) -> Result<Arc<ArcSwap<Box<str>>>> {
debug_assert!(!file.exists() || file.is_file());
debug_assert!(file.is_absolute());
let repo_dir = file.parent().context("file has no parent directory")?;
let repo = open_repo(repo_dir, None)
let repo = open_repo(repo_dir)
.context("failed to open git repo")?
.to_thread_local();
let head_ref = repo.head_ref()?;
Expand All @@ -72,10 +72,10 @@ pub fn get_current_head_name(file: &Path) -> Result<Arc<ArcSwap<Box<str>>>> {
}

pub fn for_each_changed_file(cwd: &Path, f: impl Fn(Result<FileChange>) -> bool) -> Result<()> {
status(&open_repo(cwd, None)?.to_thread_local(), f)
status(&open_repo(cwd)?.to_thread_local(), f)
}

fn open_repo(path: &Path, ceiling_dir: Option<&Path>) -> Result<ThreadSafeRepository> {
fn open_repo(path: &Path) -> Result<ThreadSafeRepository> {
// custom open options
let mut git_open_opts_map = gix::sec::trust::Mapping::<gix::open::Options>::default();

Expand Down Expand Up @@ -104,9 +104,6 @@ fn open_repo(path: &Path, ceiling_dir: Option<&Path>) -> Result<ThreadSafeReposi
});

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()
};
Expand Down

0 comments on commit dd47ed1

Please sign in to comment.