read-cache: new API write_locked_index instead of write_index/write_cache
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
33c297aacc
commit
03b8664772
@ -1986,7 +1986,7 @@ int merge_recursive_generic(struct merge_options *o,
|
||||
const unsigned char **base_list,
|
||||
struct commit **result)
|
||||
{
|
||||
int clean, index_fd;
|
||||
int clean;
|
||||
struct lock_file *lock = xcalloc(1, sizeof(struct lock_file));
|
||||
struct commit *head_commit = get_ref(head, o->branch1);
|
||||
struct commit *next_commit = get_ref(merge, o->branch2);
|
||||
@ -2003,12 +2003,11 @@ int merge_recursive_generic(struct merge_options *o,
|
||||
}
|
||||
}
|
||||
|
||||
index_fd = hold_locked_index(lock, 1);
|
||||
hold_locked_index(lock, 1);
|
||||
clean = merge_recursive(o, head_commit, next_commit, ca,
|
||||
result);
|
||||
if (active_cache_changed &&
|
||||
(write_cache(index_fd, active_cache, active_nr) ||
|
||||
commit_locked_index(lock)))
|
||||
write_locked_index(&the_index, lock, COMMIT_LOCK))
|
||||
return error(_("Unable to write index."));
|
||||
|
||||
return clean ? 0 : 1;
|
||||
|
Reference in New Issue
Block a user