diff options
Diffstat (limited to 'builtin-write-tree.c')
-rw-r--r-- | builtin-write-tree.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/builtin-write-tree.c b/builtin-write-tree.c index 70e9b6fcc6..449a4d1b57 100644 --- a/builtin-write-tree.c +++ b/builtin-write-tree.c @@ -35,7 +35,8 @@ int write_tree(unsigned char *sha1, int missing_ok, const char *prefix) missing_ok, 0) < 0) die("git-write-tree: error building trees"); if (0 <= newfd) { - if (!write_cache(newfd, active_cache, active_nr)) + if (!write_cache(newfd, active_cache, active_nr) + && !close(newfd)) commit_lock_file(lock_file); } /* Not being able to write is fine -- we are only interested |