Skip to content

Commit

Permalink
Use gix-path exe_invocation
Browse files Browse the repository at this point in the history
  • Loading branch information
maciektr committed Jun 28, 2024
1 parent e81b722 commit 23f7934
Show file tree
Hide file tree
Showing 5 changed files with 10 additions and 7 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,7 @@ fs4 = { version = "0.7", features = ["tokio"] }
fs_extra = "1"
futures = { version = "0.3", default-features = false, features = ["std", "async-await"] }
gix = ">=0.55"
gix-path = "0.10"
glob = "0.3"
ignore = "0.4"
include_dir = "0.7"
Expand Down
1 change: 1 addition & 0 deletions scarb/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ dunce.workspace = true
fs4.workspace = true
futures.workspace = true
gix.workspace = true
gix-path.workspace = true
glob.workspace = true
ignore.workspace = true
include_dir.workspace = true
Expand Down
2 changes: 1 addition & 1 deletion scarb/src/sources/git/client.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl PackageRepository {
}

fn git_command() -> Command {
let mut cmd = Command::new("git");
let mut cmd = Command::new(gix_path::env::exe_invocation());

// If Scarb is run by Git (for example, the `exec` command in `git rebase`),
// the GIT_DIR is set by Git and will point to the wrong location (this takes precedence
Expand Down
8 changes: 4 additions & 4 deletions scarb/tests/git_source.rs
Original file line number Diff line number Diff line change
Expand Up @@ -490,9 +490,9 @@ fn deps_only_cloned_to_checkouts_once() {
.success()
.stdout_matches(indoc! {r#"
[..] Updating git repository file://[..]/dep1
[..]Running git fetch --verbose --force --update-head-ok [..]dep1 +HEAD:refs/remotes/origin/HEAD
[..]Running git clone --local --verbose --config core.autocrlf=false --recurse-submodules [..].git [..]
[..]Running git reset --hard [..]
[..]Running git[EXE] fetch --verbose --force --update-head-ok [..]dep1 +HEAD:refs/remotes/origin/HEAD
[..]Running git[EXE] clone --local --verbose --config core.autocrlf=false --recurse-submodules [..].git [..]
[..]Running git[EXE] reset --hard [..]
"#});
fs::remove_file(t.child("Scarb.lock")).unwrap();
Scarb::quick_snapbox()
Expand All @@ -504,6 +504,6 @@ fn deps_only_cloned_to_checkouts_once() {
.success()
.stdout_matches(indoc! {r#"
[..] Updating git repository file://[..]/dep1
[..]Running git fetch --verbose --force --update-head-ok [..]dep1 +HEAD:refs/remotes/origin/HEAD
[..]Running git[EXE] fetch --verbose --force --update-head-ok [..]dep1 +HEAD:refs/remotes/origin/HEAD
"#});
}

0 comments on commit 23f7934

Please sign in to comment.