summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-04-25 04:50:48 (GMT)
committerJunio C Hamano <gitster@pobox.com>2008-04-25 04:50:48 (GMT)
commit31c6390d40fe12a46c38d7224da61c6771886f2a (patch)
tree3856f02ce893c6254fcb0940ec57566ec385bb76 /cache-tree.c
parent3ffb58be0a779b47e1e4d3ea584ba301461a3a77 (diff)
parent3ef6a1fe95b0a5aaca21a86651850ef5d62327fa (diff)
downloadgit-31c6390d40fe12a46c38d7224da61c6771886f2a.zip
git-31c6390d40fe12a46c38d7224da61c6771886f2a.tar.gz
git-31c6390d40fe12a46c38d7224da61c6771886f2a.tar.bz2
Merge branch 'maint-1.5.4' into maint
* maint-1.5.4: t5516: remove ambiguity test (1) Linked glossary from cvs-migration page write-tree: properly detect failure to write tree objects
Diffstat (limited to 'cache-tree.c')
-rw-r--r--cache-tree.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/cache-tree.c b/cache-tree.c
index 39da54d..73cb340 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