summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--checkout-index.c9
-rw-r--r--entry.c2
2 files changed, 8 insertions, 3 deletions
diff --git a/checkout-index.c b/checkout-index.c
index f32513c507..97845324be 100644
--- a/checkout-index.c
+++ b/checkout-index.c
@@ -63,15 +63,20 @@ static int checkout_file(const char *name)
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;
}
diff --git a/entry.c b/entry.c
index b8426dbd0d..15b34eb6f9 100644
--- a/entry.c
+++ b/entry.c
@@ -132,7 +132,7 @@ int checkout_entry(struct cache_entry *ce, struct checkout *state)
if (!state->force) {
if (!state->quiet)
fprintf(stderr, "git-checkout-index: %s already exists\n", path);
- return 0;
+ return -1;
}
/*