summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 74775a0)
raw | patch | inline | side by side (parent: 74775a0)
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | |
Wed, 7 Mar 2012 10:54:20 +0000 (17:54 +0700) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 7 Mar 2012 17:07:39 +0000 (09:07 -0800) |
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/fsck.c | patch | blob | history |
diff --git a/builtin/fsck.c b/builtin/fsck.c
index 67eb553c7dc3d8ce62fbbefbe64a90c6431963c7..a710227a64a9862c0a70f3022f901fc65b0c7f90 100644 (file)
--- a/builtin/fsck.c
+++ b/builtin/fsck.c
#include "parse-options.h"
#include "dir.h"
#include "progress.h"
+#include "streaming.h"
#define REACHABLE 0x0001
#define SEEN 0x0002
if (!(f = fopen(filename, "w")))
die_errno("Could not open '%s'", filename);
if (obj->type == OBJ_BLOB) {
- enum object_type type;
- unsigned long size;
- char *buf = read_sha1_file(obj->sha1,
- &type, &size);
- if (buf && fwrite(buf, 1, size, f) != size)
+ if (stream_blob_to_fd(fileno(f), obj->sha1, NULL, 1))
die_errno("Could not write '%s'", filename);
- free(buf);
} else
fprintf(f, "%s\n", sha1_to_hex(obj->sha1));
if (fclose(f))