summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 64a2228)
raw | patch | inline | side by side (parent: 64a2228)
author | Junio C Hamano <junkio@cox.net> | |
Mon, 3 Oct 2005 19:44:48 +0000 (12:44 -0700) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Wed, 5 Oct 2005 00:04:44 +0000 (17:04 -0700) |
Without -f flag, 'git-checkout-index foo.c' issued an error message
when foo.c already existed in the working tree and did not match index.
However it did not return an error from the underlying checkout_entry()
function and resulted in a successful exit(0).
Signed-off-by: Junio C Hamano <junkio@cox.net>
when foo.c already existed in the working tree and did not match index.
However it did not return an error from the underlying checkout_entry()
function and resulted in a successful exit(0).
Signed-off-by: Junio C Hamano <junkio@cox.net>
checkout-index.c | patch | blob | history | |
entry.c | patch | blob | history |
diff --git a/checkout-index.c b/checkout-index.c
index f32513c507ff39e09082a9ae7b3bf157f7d21fe9..97845324beb9002a0fed0dd1184988716faa9ed2 100644 (file)
--- a/checkout-index.c
+++ b/checkout-index.c
static int checkout_all(void)
{
- int i;
+ int i, errs = 0;
for (i = 0; i < active_nr ; i++) {
struct cache_entry *ce = active_cache[i];
if (ce_stage(ce))
continue;
if (checkout_entry(ce, &state) < 0)
- return -1;
+ errs++;
}
+ if (errs)
+ /* we have already done our error reporting.
+ * exit with the same code as die().
+ */
+ exit(128);
return 0;
}