diff --git a/builtin-apply.c b/builtin-apply.c
index 4b8311b4de3f5c5d93352dac62856d67acfb143f..fd92ef7174dae1586921ebd34233c93b381106de 100644 (file)
--- a/builtin-apply.c
+++ b/builtin-apply.c
update_index = check_index && apply;
if (update_index && newfd < 0)
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");
if (check_index) {
if (read_cache() < 0)
die("unable to read index file");
if (update_index) {
if (write_cache(newfd, active_cache, active_nr) ||
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");
}
die("Unable to write new index file");
}