X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=builtin-apply.c;h=fd92ef7174dae1586921ebd34233c93b381106de;hb=f48fd68887a03756658a46486a5dd1301c5a655f;hp=4b8311b4de3f5c5d93352dac62856d67acfb143f;hpb=77e6f5bc1009aa588a3b2235758bf5be13b23d85;p=git.git diff --git a/builtin-apply.c b/builtin-apply.c index 4b8311b4d..fd92ef717 100644 --- a/builtin-apply.c +++ b/builtin-apply.c @@ -2664,8 +2664,8 @@ static int apply_patch(int fd, const char *filename, int inaccurate_eof) update_index = check_index && apply; if (update_index && newfd < 0) - newfd = hold_lock_file_for_update(&lock_file, - get_index_file(), 1); + newfd = hold_locked_index(&lock_file, 1); + if (check_index) { if (read_cache() < 0) die("unable to read index file"); @@ -2872,7 +2872,7 @@ int cmd_apply(int argc, const char **argv, const char *unused_prefix) if (update_index) { if (write_cache(newfd, active_cache, active_nr) || - close(newfd) || commit_lock_file(&lock_file)) + close(newfd) || commit_locked_index(&lock_file)) die("Unable to write new index file"); }