X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=write-tree.c;h=d6a605893dcbb4d8d65979309cf9ce1199aa8279;hb=e968751573a4ded76201a0e4414ec36649a92dda;hp=a5069921a0f01e872c5e7c62f836cd0b4441e551;hpb=b8ed7f0f40743dae6111c8950ba55051933298ca;p=git.git diff --git a/write-tree.c b/write-tree.c index a5069921..d6a60589 100644 --- a/write-tree.c +++ b/write-tree.c @@ -11,7 +11,7 @@ static int missing_ok = 0; static const char write_tree_usage[] = "git-write-tree [--missing-ok]"; -static struct cache_file cache_file; +static struct lock_file lock_file; int main(int argc, char **argv) { @@ -19,7 +19,7 @@ int main(int argc, char **argv) setup_git_directory(); - newfd = hold_index_file_for_update(&cache_file, get_index_file()); + newfd = hold_lock_file_for_update(&lock_file, get_index_file()); entries = read_cache(); if (argc == 2) { if (!strcmp(argv[1], "--missing-ok")) @@ -41,11 +41,11 @@ int main(int argc, char **argv) if (!was_valid) { if (cache_tree_update(active_cache_tree, active_cache, active_nr, - missing_ok) < 0) + missing_ok, 0) < 0) die("git-write-tree: error building trees"); if (0 <= newfd) { if (!write_cache(newfd, active_cache, active_nr)) - commit_index_file(&cache_file); + commit_lock_file(&lock_file); } /* Not being able to write is fine -- we are only interested * in updating the cache-tree part, and if the next caller