summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorQuentin Carbonneaux2014-08-11 17:47:08 -0400
committerQuentin Carbonneaux2014-08-11 17:47:08 -0400
commitf18cd5260641ba7bb9157e4030aa2af68c9f966e (patch)
tree2423bf8d515d9819d148687ca4faaa04b1495d8e
parent2e4047d0ce3beccde0a1756ad861744b8e764944 (diff)
fail in get if current file is dirty
-rw-r--r--exec.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/exec.c b/exec.c
index 4dba4bd..49991f1 100644
--- a/exec.c
+++ b/exec.c
@@ -95,6 +95,11 @@ ex_get(EBuf *eb, char *file)
struct stat st;
char *file1;
+ if (eb->path && strcmp(eb->path, file) != 0)
+ if (eb->frev != eb_revision(eb)) {
+ errstr = "file not written";
+ return 1;
+ }
if (!file)
file = eb->path;
if (!file) {