@matheusbsbs / matheus-bagliano / commits / f648ee7088
Fork 0

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>

Jeff King committed Oct 18, 2019 at 01:00 UTC f648ee70885ce09558101640f540ebec2013cd80
1 file changed +4 -4
fsck.c
+4 -4
@@ -767,7 +767,7 @@ static int fsck_ident(const char **ident,
767 static int fsck_commit(struct commit *commit, const char *buffer,
768 unsigned long size, struct fsck_options *options)
769 {
770 - struct object_id tree_oid, oid;
770 + struct object_id tree_oid, parent_oid;
771 unsigned author_count;
772 int err;
773 const char *buffer_begin = buffer;
@@ -786,7 +786,7 @@ static int fsck_commit(struct commit *commit, const char *buffer,
786 }
787 buffer = p + 1;
788 while (skip_prefix(buffer, "parent ", &buffer)) {
789 - if (parse_oid_hex(buffer, &oid, &p) || *p != '\n') {
789 + if (parse_oid_hex(buffer, &parent_oid, &p) || *p != '\n') {
790 err = report(options, &commit->object.oid, commit->object.type, FSCK_MSG_BAD_PARENT_SHA1, "invalid 'parent' line format - bad sha1");
791 if (err)
792 return err;
@@ -823,7 +823,7 @@ static int fsck_commit(struct commit *commit, const char *buffer,
823 static int fsck_tag(struct tag *tag, const char *buffer,
824 unsigned long size, struct fsck_options *options)
825 {
826 - struct object_id oid;
826 + struct object_id tagged_oid;
827 int ret = 0;
828 char *eol;
829 struct strbuf sb = STRBUF_INIT;
@@ -837,7 +837,7 @@ static int fsck_tag(struct tag *tag, const char *buffer,
837 ret = report(options, &tag->object.oid, tag->object.type, FSCK_MSG_MISSING_OBJECT, "invalid format - expected 'object' line");
838 goto done;
839 }
840 - if (parse_oid_hex(buffer, &oid, &p) || *p != '\n') {
840 + if (parse_oid_hex(buffer, &tagged_oid, &p) || *p != '\n') {
841 ret = report(options, &tag->object.oid, tag->object.type, FSCK_MSG_BAD_OBJECT_SHA1, "invalid 'object' line format - bad sha1");
842 if (ret)
843 goto done;