fsck.c:fsck_ident(): ident points at a const string

Since fsck_ident doesn't change the content of **ident, the type of ident could be const char **. This change is required to rewrite fsck_commit() to use skip_prefix(). Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com> Helped-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Yuxuan Shui committed Mar 13, 2014 at 12:45 UTC de42180f6a645491c7ca8683ff2d5060f85f0c51
1 file changed +2 -2
fsck.c
+2 -2
@@ -243,7 +243,7 @@ static int fsck_tree(struct tree *item, int strict, fsck_error error_func)
243 return retval;
244 }
245
246 -static int fsck_ident(char **ident, struct object *obj, fsck_error error_func)
246 +static int fsck_ident(const char **ident, struct object *obj, fsck_error error_func)
247 {
248 if (**ident == '<')
249 return error_func(obj, FSCK_ERROR, "invalid author/committer line - missing space before email");
@@ -281,7 +281,7 @@ static int fsck_ident(char **ident, struct object *obj, fsck_error error_func)
281
282 static int fsck_commit(struct commit *commit, fsck_error error_func)
283 {
284 - char *buffer = commit->buffer;
284 + const char *buffer = commit->buffer;
285 unsigned char tree_sha1[20], sha1[20];
286 struct commit_graft *graft;
287 int parents = 0;