diff --git a/cache-tree.c b/cache-tree.c
index 39da54d1e56b5905655eafed1aff0f51c2540a8e..5f8ee87bb1c446341b640c2f978a658d6bfcfcd0 100644 (file)
--- a/cache-tree.c
+++ b/cache-tree.c
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
return read_one(&buffer, &size);
}
-struct cache_tree *cache_tree_find(struct cache_tree *it, const char *path)
+static struct cache_tree *cache_tree_find(struct cache_tree *it, const char *path)
{
while (*path) {
const char *slash;