X-Git-Url: https://git.octo.it/?a=blobdiff_plain;f=commit-tree.c;h=16c17871334601b0b3c211cbedd8e8291af261a3;hb=22c31bf183bff576c7807f9d67abfc11ee8e1fa4;hp=88871b022d41eb7542407633419ea1aa1b74c576;hpb=5be4eabf90a4f6d14d3ae16772e6b2e063d71587;p=git.git diff --git a/commit-tree.c b/commit-tree.c index 88871b02..16c17871 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; }