diff options
Diffstat (limited to 'cache-tree.c')
-rw-r--r-- | cache-tree.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/cache-tree.c b/cache-tree.c index 39da54d1e5..73cb340707 100644 --- a/cache-tree.c +++ b/cache-tree.c @@ -341,8 +341,11 @@ static int update_one(struct cache_tree *it, if (dryrun) hash_sha1_file(buffer.buf, buffer.len, tree_type, it->sha1); - else - write_sha1_file(buffer.buf, buffer.len, tree_type, it->sha1); + else if (write_sha1_file(buffer.buf, buffer.len, tree_type, it->sha1)) { + strbuf_release(&buffer); + return -1; + } + strbuf_release(&buffer); it->entry_count = i; #if DEBUG |