Skip to content

Commit

Permalink
Merge branch 'jn/rerere-fail-on-auto-update-failure' into maint
Browse files Browse the repository at this point in the history
"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
  • Loading branch information
Junio C Hamano committed Feb 25, 2015
2 parents faf723a + 89ea903 commit 74419c2
Showing 1 changed file with 6 additions and 10 deletions.
16 changes: 6 additions & 10 deletions rerere.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,27 +477,23 @@ static int merge(const char *name, const char *path)

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)
Expand Down

0 comments on commit 74419c2

Please sign in to comment.