mirror of
https://github.com/NixOS/nix.git
synced 2025-11-14 14:32:42 +01:00
Add flags to disallow dirty Git trees and to turn off warnings
This commit is contained in:
parent
99e8e58f2d
commit
68e0f23edc
4 changed files with 21 additions and 6 deletions
|
|
@ -47,7 +47,11 @@ GitInfo exportGit(ref<Store> store, std::string uri,
|
|||
/* This is an unclean working tree. So copy all tracked
|
||||
files. */
|
||||
|
||||
warn("Git tree '%s' is dirty", uri);
|
||||
if (!evalSettings.allowDirty)
|
||||
throw Error("Git tree '%s' is dirty", uri);
|
||||
|
||||
if (evalSettings.warnDirty)
|
||||
warn("Git tree '%s' is dirty", uri);
|
||||
|
||||
GitInfo gitInfo;
|
||||
gitInfo.ref = "HEAD";
|
||||
|
|
|
|||
|
|
@ -36,7 +36,11 @@ HgInfo exportMercurial(ref<Store> store, const std::string & uri,
|
|||
/* This is an unclean working tree. So copy all tracked
|
||||
files. */
|
||||
|
||||
printTalkative("copying unclean Mercurial working tree '%s'", uri);
|
||||
if (!evalSettings.allowDirty)
|
||||
throw Error("Mercurial tree '%s' is unclean", uri);
|
||||
|
||||
if (evalSettings.warnDirty)
|
||||
warn("Mercurial tree '%s' is unclean", uri);
|
||||
|
||||
HgInfo hgInfo;
|
||||
hgInfo.rev = "0000000000000000000000000000000000000000";
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue