diff options
| author | bors <bors@rust-lang.org> | 2016-09-29 03:48:02 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2016-09-29 03:48:02 -0700 |
| commit | 704bcc0ddafc0b3c3f4879286204442d43169e30 (patch) | |
| tree | a705ea6d1d27f609b436da9f20c3715b81b0dce0 /src/bootstrap | |
| parent | 91f34c0c70746f5c938d25d02a8a66b41240b2f0 (diff) | |
| parent | d68f7eb865b1b1be5393b440d9122d4f7c4497c2 (diff) | |
Auto merge of #36456 - alexcrichton:rustbuild-dont-use-c, r=jonathandturner
rustbuild: Use current_dir instead of -C Apparently some versions of git don't support the `-C` flag, so let's use the guaranteed-to-work `current_dir` function.
Diffstat (limited to 'src/bootstrap')
| -rw-r--r-- | src/bootstrap/lib.rs | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/bootstrap/lib.rs b/src/bootstrap/lib.rs index 784ca6f5cc4..3d1cf47cb7e 100644 --- a/src/bootstrap/lib.rs +++ b/src/bootstrap/lib.rs @@ -557,12 +557,18 @@ impl Build { continue } + if !submodule.path.exists() { + t!(fs::create_dir_all(&submodule.path)); + } + match submodule.state { State::MaybeDirty => { // drop staged changes - self.run(git().arg("-C").arg(submodule.path).args(&["reset", "--hard"])); + self.run(git().current_dir(submodule.path) + .args(&["reset", "--hard"])); // drops unstaged changes - self.run(git().arg("-C").arg(submodule.path).args(&["clean", "-fdx"])); + self.run(git().current_dir(submodule.path) + .args(&["clean", "-fdx"])); }, State::NotInitialized => { self.run(git_submodule().arg("init").arg(submodule.path)); @@ -571,8 +577,10 @@ impl Build { State::OutOfSync => { // drops submodule commits that weren't reported to the (outer) git repository self.run(git_submodule().arg("update").arg(submodule.path)); - self.run(git().arg("-C").arg(submodule.path).args(&["reset", "--hard"])); - self.run(git().arg("-C").arg(submodule.path).args(&["clean", "-fdx"])); + self.run(git().current_dir(submodule.path) + .args(&["reset", "--hard"])); + self.run(git().current_dir(submodule.path) + .args(&["clean", "-fdx"])); }, } } |
