aboutsummaryrefslogtreecommitdiff
path: root/commit-tree.c
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-25 17:43:22 -0800
committerJunio C Hamano <junkio@cox.net>2006-03-25 17:43:22 -0800
commit48d6e97afe4dcce3bb01922b768cc4d831923e7f (patch)
treec5b1e7b23bc6ff1e6b6afc62ee826a46d06adc06 /commit-tree.c
parent88d9405600ece221306ac98db68c6bf756e1ff09 (diff)
parent4c691724f175573a2dc4118782744cb0e852ab41 (diff)
downloadgit-48d6e97afe4dcce3bb01922b768cc4d831923e7f.tar.xz
Merge branch 'rs/tar-tree' into next
* rs/tar-tree: tar-tree: Use the prefix field of a tar header tar-tree: Remove obsolete code tar-tree: Use write_entry() to write the archive contents tar-tree: Introduce write_entry() tar-tree: Use SHA1 of root tree for the basedir git-apply: safety fixes Removed bogus "<snap>" identifier. Clarify and expand some hook documentation. commit-tree: check return value from write_sha1_file() send-email: Identify author at the top when sending e-mail Format tweaks for asciidoc.
Diffstat (limited to 'commit-tree.c')
-rw-r--r--commit-tree.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/commit-tree.c b/commit-tree.c
index 88871b022d..16c1787133 100644
--- a/commit-tree.c
+++ b/commit-tree.c
@@ -125,7 +125,10 @@ int main(int argc, char **argv)
while (fgets(comment, sizeof(comment), stdin) != NULL)
add_buffer(&buffer, &size, "%s", comment);
- write_sha1_file(buffer, size, "commit", commit_sha1);
- printf("%s\n", sha1_to_hex(commit_sha1));
- return 0;
+ if (!write_sha1_file(buffer, size, "commit", commit_sha1)) {
+ printf("%s\n", sha1_to_hex(commit_sha1));
+ return 0;
+ }
+ else
+ return 1;
}