mirror of
https://github.com/rust-lang/cargo
synced 2024-10-30 03:28:38 +00:00
Auto merge of #6280 - zachreizner:master, r=dwijnand
use allow-dirty option in `cargo package` to skip vcs checks If `cargo package` is run for a crate that is not version controlled in a way that cargo expects, git2 will overreach upwards and grab a irrelevant .git repo. This change uses `--allow-dirty` to imply to `cargo package` that it should not be checking for version control information, fixing this issue.
This commit is contained in:
commit
e70bccff8b
1 changed files with 6 additions and 2 deletions
|
@ -55,8 +55,12 @@ pub fn package(ws: &Workspace, opts: &PackageOpts) -> CargoResult<Option<FileLoc
|
|||
// Check (git) repository state, getting the current commit hash if not
|
||||
// dirty. This will `bail!` if dirty, unless allow_dirty. Produce json
|
||||
// info for any sha1 (HEAD revision) returned.
|
||||
let vcs_info = check_repo_state(pkg, &src_files, &config, opts.allow_dirty)?
|
||||
.map(|h| json!({"git":{"sha1": h}}));
|
||||
let vcs_info = if !opts.allow_dirty {
|
||||
check_repo_state(pkg, &src_files, &config, opts.allow_dirty)?
|
||||
.map(|h| json!({"git":{"sha1": h}}))
|
||||
} else {
|
||||
None
|
||||
};
|
||||
|
||||
if opts.list {
|
||||
let root = pkg.root();
|
||||
|
|
Loading…
Reference in a new issue