Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <junkio@cox.net>2006-03-25 09:23:25 +0300
committerJunio C Hamano <junkio@cox.net>2006-03-25 09:23:25 +0300
commit7561d9f54412fcf443ebb28040bad67cd054a986 (patch)
tree4c06ce141bbf55b793b0022b2b83dec7d4a40be6 /commit-tree.c
parent79f558a5fc1c471e5db926a1272fe930f24784bb (diff)
commit-tree: check return value from write_sha1_file()
... found by Matthias Kestenholz. Signed-off-by: Junio C Hamano <junkio@cox.net>
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;
}