summaryrefslogtreecommitdiff
path: root/fsck.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2019-10-18 01:00:59 -0400
committerJunio C Hamano <gitster@pobox.com>2019-10-28 14:05:18 +0900
commitf648ee70885ce09558101640f540ebec2013cd80 (patch)
tree9f1944f8a234f76a1b566e72a1abbabdd6cb903f /fsck.c
parentcc579000bf289cea7f9c2e34fcb9cf67e8104616 (diff)
downloadgit-f648ee70885ce09558101640f540ebec2013cd80.tar.gz
fsck: rename vague "oid" local variables
In fsck_commit() and fsck_tag(), we have local "oid" variables used for parsing parent and tagged-object oids. Let's give these more specific names in preparation for the functions taking an "oid" parameter for the object we're checking. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'fsck.c')
-rw-r--r--fsck.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/fsck.c b/fsck.c
index 50c93200ed..42e7d1f71f 100644
--- a/fsck.c
+++ b/fsck.c
@@ -767,7 +767,7 @@ static int fsck_ident(const char **ident,
static int fsck_commit(struct commit *commit, const char *buffer,
unsigned long size, struct fsck_options *options)
{
- struct object_id tree_oid, oid;
+ struct object_id tree_oid, parent_oid;
unsigned author_count;
int err;
const char *buffer_begin = buffer;
@@ -786,7 +786,7 @@ static int fsck_commit(struct commit *commit, const char *buffer,
}
buffer = p + 1;
while (skip_prefix(buffer, "parent ", &buffer)) {
- if (parse_oid_hex(buffer, &oid, &p) || *p != '\n') {
+ if (parse_oid_hex(buffer, &parent_oid, &p) || *p != '\n') {
err = report(options, &commit->object.oid, commit->object.type, FSCK_MSG_BAD_PARENT_SHA1, "invalid 'parent' line format - bad sha1");
if (err)
return err;
@@ -823,7 +823,7 @@ static int fsck_commit(struct commit *commit, const char *buffer,
static int fsck_tag(struct tag *tag, const char *buffer,
unsigned long size, struct fsck_options *options)
{
- struct object_id oid;
+ struct object_id tagged_oid;
int ret = 0;
char *eol;
struct strbuf sb = STRBUF_INIT;
@@ -837,7 +837,7 @@ static int fsck_tag(struct tag *tag, const char *buffer,
ret = report(options, &tag->object.oid, tag->object.type, FSCK_MSG_MISSING_OBJECT, "invalid format - expected 'object' line");
goto done;
}
- if (parse_oid_hex(buffer, &oid, &p) || *p != '\n') {
+ if (parse_oid_hex(buffer, &tagged_oid, &p) || *p != '\n') {
ret = report(options, &tag->object.oid, tag->object.type, FSCK_MSG_BAD_OBJECT_SHA1, "invalid 'object' line format - bad sha1");
if (ret)
goto done;