Skip to content

Commit 2fa95e3

Browse files
committed
Add "Updating" status for git submodules.
1 parent 94c7bc7 commit 2fa95e3

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/cargo/sources/git/utils.rs

+3
Original file line numberDiff line numberDiff line change
@@ -392,6 +392,9 @@ impl<'a> GitCheckout<'a> {
392392
};
393393
// Fetch data from origin and reset to the head commit
394394
let refspec = "refs/heads/*:refs/heads/*";
395+
cargo_config
396+
.shell()
397+
.status("Updating", format!("git submodule `{}`", url))?;
395398
fetch(&mut repo, url, refspec, cargo_config).chain_err(|| {
396399
format!(
397400
"failed to fetch submodule `{}` from {}",

tests/testsuite/git.rs

+4
Original file line numberDiff line numberDiff line change
@@ -878,6 +878,7 @@ fn dep_with_submodule() {
878878
.with_stderr(
879879
"\
880880
[UPDATING] git repository [..]
881+
[UPDATING] git submodule `file://[..]/dep2`
881882
[COMPILING] dep1 [..]
882883
[COMPILING] foo [..]
883884
[FINISHED] dev [unoptimized + debuginfo] target(s) in [..]\n",
@@ -941,6 +942,7 @@ fn dep_with_bad_submodule() {
941942
let expected = format!(
942943
"\
943944
[UPDATING] git repository [..]
945+
[UPDATING] git submodule `file://[..]/dep2`
944946
[ERROR] failed to get `dep1` as a dependency of package `foo v0.5.0 [..]`
945947
946948
Caused by:
@@ -1182,6 +1184,7 @@ fn dep_with_changed_submodule() {
11821184
p.cargo("run")
11831185
.with_stderr(
11841186
"[UPDATING] git repository `[..]`\n\
1187+
[UPDATING] git submodule `file://[..]/dep2`\n\
11851188
[COMPILING] dep1 v0.5.0 ([..])\n\
11861189
[COMPILING] foo v0.5.0 ([..])\n\
11871190
[FINISHED] dev [unoptimized + debuginfo] target(s) in \
@@ -1229,6 +1232,7 @@ fn dep_with_changed_submodule() {
12291232
.with_stderr("")
12301233
.with_stderr(&format!(
12311234
"[UPDATING] git repository `{}`\n\
1235+
[UPDATING] git submodule `file://[..]/dep3`\n\
12321236
[UPDATING] dep1 v0.5.0 ([..]) -> #[..]\n\
12331237
",
12341238
git_project.url()

0 commit comments

Comments
 (0)