aboutsummaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/fsck.c b/fsck.c
index bdbea2b99..a4e8593e7 100644
--- a/fsck.c
+++ b/fsck.c
@@ -276,9 +276,9 @@ static int fsck_ident(const char **ident, struct object *obj, fsck_error error_f
return 0;
}
-static int fsck_commit(struct commit *commit, fsck_error error_func)
+static int fsck_commit_buffer(struct commit *commit, const char *buffer,
+ fsck_error error_func)
{
- const char *buffer = commit->buffer;
unsigned char tree_sha1[20], sha1[20];
struct commit_graft *graft;
int parents = 0;
@@ -332,6 +332,14 @@ static int fsck_commit(struct commit *commit, fsck_error error_func)
return 0;
}
+static int fsck_commit(struct commit *commit, fsck_error error_func)
+{
+ const char *buffer = get_commit_buffer(commit, NULL);
+ int ret = fsck_commit_buffer(commit, buffer, error_func);
+ unuse_commit_buffer(commit, buffer);
+ return ret;
+}
+
static int fsck_tag(struct tag *tag, fsck_error error_func)
{
struct object *tagged = tag->tagged;