diff --git a/src/cargo/sources/git/utils.rs b/src/cargo/sources/git/utils.rs index 844a4dcf58b..f9b2f582c81 100644 --- a/src/cargo/sources/git/utils.rs +++ b/src/cargo/sources/git/utils.rs @@ -1193,6 +1193,8 @@ fn fetch_with_cli( cmd.arg("fetch"); if tags { cmd.arg("--tags"); + } else { + cmd.arg("--no-tags"); } match gctx.shell().verbosity() { Verbosity::Normal => {} diff --git a/tests/testsuite/git.rs b/tests/testsuite/git.rs index 0fd25bf2db0..6bc72423c72 100644 --- a/tests/testsuite/git.rs +++ b/tests/testsuite/git.rs @@ -2954,7 +2954,7 @@ fn use_the_cli() { let stderr = str![[r#" [UPDATING] git repository `[ROOTURL]/dep1` -[RUNNING] `git fetch --verbose --force --update-head-ok [..][ROOTURL]/dep1[..] [..]+HEAD:refs/remotes/origin/HEAD[..]` +[RUNNING] `git fetch --no-tags --verbose --force --update-head-ok [..][ROOTURL]/dep1[..] [..]+HEAD:refs/remotes/origin/HEAD[..]` From [ROOTURL]/dep1 * [new ref] [..] -> origin/HEAD[..] [LOCKING] 1 package to latest compatible version