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:
authorAlex Riesen <raa.lkml@gmail.com>2007-12-12 01:01:28 +0300
committerJunio C Hamano <gitster@pobox.com>2007-12-12 21:59:22 +0300
commitb0fe0d7258951779b790190b10ca21ffc5573546 (patch)
tree267d8b48341afbf97131f441cc0b7402be4b4071 /builtin-fast-export.c
parentd4110a9726c7cd5cda35b7dd03dc8f85fe3dff0c (diff)
Fix git-fast-export for zero-sized blobs
Writing 1 elements of size 0-byte successfully will cause fwrite(3) to return 0, and flagging it as error is a mistake. Signed-off-by: Alex Riesen <raa.lkml@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-fast-export.c')
-rwxr-xr-xbuiltin-fast-export.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/builtin-fast-export.c b/builtin-fast-export.c
index 2136aadfd7..ef27eee71b 100755
--- a/builtin-fast-export.c
+++ b/builtin-fast-export.c
@@ -103,7 +103,7 @@ static void handle_object(const unsigned char *sha1)
mark_object(object);
printf("blob\nmark :%d\ndata %lu\n", last_idnum, size);
- if (fwrite(buf, size, 1, stdout) != 1)
+ if (size && fwrite(buf, size, 1, stdout) != 1)
die ("Could not write blob %s", sha1_to_hex(sha1));
printf("\n");