1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 20:01:15 +02:00

Add flags to disallow dirty Git trees and to turn off warnings

This commit is contained in:
Eelco Dolstra 2019-09-20 14:29:49 +02:00
parent 99e8e58f2d
commit 68e0f23edc
4 changed files with 21 additions and 6 deletions

View file

@ -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";