Skip to content

Commit 3de0b23

Browse files
authored
Take workdir into account in gix_repo (#2789)
* Use gix_repo in get_tags * Take workdir into account in gix_repo
1 parent 8a57155 commit 3de0b23

File tree

5 files changed

+66
-84
lines changed

5 files changed

+66
-84
lines changed

Cargo.lock

Lines changed: 54 additions & 76 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

asyncgit/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ easy-cast = "0.5"
2424
fuzzy-matcher = "0.3"
2525
git2 = "0.20"
2626
git2-hooks = { path = "../git2-hooks", version = ">=0.5" }
27-
gix = { version = "0.74.1", default-features = false, features = [
27+
gix = { version = "0.75.0", default-features = false, features = [
2828
"max-performance",
2929
"revision",
3030
"mailmap",

asyncgit/src/sync/repository.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,10 +69,14 @@ pub fn repo(repo_path: &RepoPath) -> Result<Repository> {
6969
}
7070

7171
pub fn gix_repo(repo_path: &RepoPath) -> Result<gix::Repository> {
72-
let repo = gix::ThreadSafeRepository::discover_with_environment_overrides(
72+
let mut repo: gix::Repository = gix::ThreadSafeRepository::discover_with_environment_overrides(
7373
repo_path.gitpath(),
7474
)
7575
.map(Into::into)?;
7676

77+
if let Some(workdir) = repo_path.workdir() {
78+
repo.set_workdir(Some(workdir.into()))?;
79+
}
80+
7781
Ok(repo)
7882
}

asyncgit/src/sync/status.rs

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ mod tests {
297297
};
298298

299299
#[test]
300-
#[should_panic]
301300
fn test_get_status_with_workdir() {
302301
let (git_dir, _repo) = repo_init_bare().unwrap();
303302

0 commit comments

Comments
 (0)