summaryrefslogtreecommitdiff
path: root/cache-tree.c
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-04-24 22:40:02 -0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-04-24 22:40:02 -0700
commit049a226fa14fb25c03d2146c2f8f184cfea5e5bf (patch)
treef67e46f678cc570a21852e17268afff0ae2120cc /cache-tree.c
parentMerge branch 'maint' (diff)
parentremote: create fetch config lines with '+' (diff)
downloadtgif-049a226fa14fb25c03d2146c2f8f184cfea5e5bf.tar.xz
Merge branch 'maint'
* maint: remote: create fetch config lines with '+' push: allow unqualified dest refspecs to DWIM doc/git-gc: add a note about what is collected 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 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