summaryrefslogtreecommitdiff
path: root/rerere.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2015-02-24 22:10:13 -0800
committerJunio C Hamano <gitster@pobox.com>2015-02-24 22:10:13 -0800
commit74419c29df3f5c6b25bf0208222ddbf76b37acda (patch)
tree5f7f975adabcdd823ec0d156ba98e1ed800c6720 /rerere.c
parentfaf723a631aff822b4808c496c0970edb0ca2a99 (diff)
parent89ea90351dd32fbe384d0cf844640a9c55606f3b (diff)
downloadgit-74419c29df3f5c6b25bf0208222ddbf76b37acda.tar.gz
Merge branch 'jn/rerere-fail-on-auto-update-failure' into maint
"git rerere" (invoked internally from many mergy operations) did not correctly signal errors when told to update the working tree files and failed to do so for whatever reason. * jn/rerere-fail-on-auto-update-failure: rerere: error out on autoupdate failure
Diffstat (limited to 'rerere.c')
-rw-r--r--rerere.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/rerere.c b/rerere.c
index 1b0555f1a5..31644dec04 100644
--- a/rerere.c
+++ b/rerere.c
@@ -477,27 +477,23 @@ out:
static struct lock_file index_lock;
-static int update_paths(struct string_list *update)
+static void update_paths(struct string_list *update)
{
int i;
- int fd = hold_locked_index(&index_lock, 0);
- int status = 0;
- if (fd < 0)
- return -1;
+ hold_locked_index(&index_lock, 1);
for (i = 0; i < update->nr; i++) {
struct string_list_item *item = &update->items[i];
- if (add_file_to_cache(item->string, ADD_CACHE_IGNORE_ERRORS))
- status = -1;
+ if (add_file_to_cache(item->string, 0))
+ exit(128);
}
- if (!status && active_cache_changed) {
+ if (active_cache_changed) {
if (write_locked_index(&the_index, &index_lock, COMMIT_LOCK))
die("Unable to write new index file");
- } else if (fd >= 0)
+ } else
rollback_lock_file(&index_lock);
- return status;
}
static int do_plain_rerere(struct string_list *rr, int fd)