Skip to content

Commit

Permalink
Fix build.rs: only update libgit2 submodule (rust-lang#574) (rust-lan…
Browse files Browse the repository at this point in the history
…g#575)

If the user (for whatever reason) has their $CARGO_HOME
in a git repository, and libgit2-sys is built in there
(e.g. as a dependency of cargo), the build script will
erroneously update all submodules in our parent directories.

This wasn't intended - we only wish to update libgit2.

This commit corrects this by specifying the current directory
when calling git submodule update.

Co-authored-by: Antonius Mulder <github@mldr.id.au>
  • Loading branch information
Muld0r and muld0r committed Jun 23, 2020
1 parent fc80b4e commit 627fd88
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion libgit2-sys/build.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ fn main() {

if !Path::new("libgit2/.git").exists() {
let _ = Command::new("git")
.args(&["submodule", "update", "--init"])
.args(&["submodule", "update", "--init", "libgit2"])
.status();
}

Expand Down

0 comments on commit 627fd88

Please sign in to comment.