Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
commit-tree: check return value from write_sha1_file()
author
Junio C Hamano
<junkio@cox.net>
Sat, 25 Mar 2006 06:23:25 +0000
(22:23 -0800)
committer
Junio C Hamano
<junkio@cox.net>
Sat, 25 Mar 2006 06:23:25 +0000
(22:23 -0800)
... found by Matthias Kestenholz.
Signed-off-by: Junio C Hamano <junkio@cox.net>
commit-tree.c
patch
|
blob
|
history
raw
|
patch
| inline |
side by side
(parent:
79f558a
)
diff --git
a/commit-tree.c
b/commit-tree.c
index 88871b022d41eb7542407633419ea1aa1b74c576..16c17871334601b0b3c211cbedd8e8291af261a3 100644
(file)
--- 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;
}