diff --git a/src/cargo/ops/cargo_package.rs b/src/cargo/ops/cargo_package.rs index fb0ff6a21d3..b1b2ba3a91e 100644 --- a/src/cargo/ops/cargo_package.rs +++ b/src/cargo/ops/cargo_package.rs @@ -59,7 +59,7 @@ pub fn package(ws: &Workspace, opts: &PackageOpts) -> CargoResult CargoResult<()> { Ok(()) } -fn check_not_dirty(p: &Package, src: &PathSource) -> CargoResult<()> { +fn check_not_dirty(p: &Package, src: &PathSource, config: &Config) -> CargoResult<()> { if let Ok(repo) = git2::Repository::discover(p.root()) { if let Some(workdir) = repo.workdir() { debug!( @@ -172,6 +172,7 @@ fn check_not_dirty(p: &Package, src: &PathSource) -> CargoResult<()> { // No VCS recognized, we don't know if the directory is dirty or not, so we // have to assume that it's clean. + config.shell().verbose(|shell| shell.warn("No (git) VCS found"))?; return Ok(()); fn git(p: &Package, src: &PathSource, repo: &git2::Repository) -> CargoResult<()> { diff --git a/tests/testsuite/package.rs b/tests/testsuite/package.rs index 6eb1e0f15fd..a04bbdfc5fb 100644 --- a/tests/testsuite/package.rs +++ b/tests/testsuite/package.rs @@ -397,6 +397,7 @@ fn exclude() { "\ [WARNING] manifest has no description[..] See http://doc.crates.io/manifest.html#package-metadata for more info. +[WARNING] No (git) VCS found [PACKAGING] foo v0.0.1 ([..]) [WARNING] [..] file `dir_root_1[/]some_dir[/]file` WILL be excluded [..] See [..] @@ -488,6 +489,7 @@ fn include() { "\ [WARNING] manifest has no description[..] See http://doc.crates.io/manifest.html#package-metadata for more info. +[WARNING] No (git) VCS found [PACKAGING] foo v0.0.1 ([..]) [ARCHIVING] [..] [ARCHIVING] [..]