Skip to content

Commit c87b653

Browse files
stefanbellergitster
authored andcommitted
builtin/describe.c: rename oid to avoid variable shadowing
The function `describe` has already a variable named `oid` declared at the beginning of the function for an object id. Do not shadow that variable with a pointer to an object id. Signed-off-by: Stefan Beller <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent ce5b6f9 commit c87b653

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/describe.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -381,9 +381,9 @@ static void describe(const char *arg, int last_one)
381381
}
382382

383383
if (!match_cnt) {
384-
struct object_id *oid = &cmit->object.oid;
384+
struct object_id *cmit_oid = &cmit->object.oid;
385385
if (always) {
386-
printf("%s", find_unique_abbrev(oid->hash, abbrev));
386+
printf("%s", find_unique_abbrev(cmit_oid->hash, abbrev));
387387
if (suffix)
388388
printf("%s", suffix);
389389
printf("\n");
@@ -392,11 +392,11 @@ static void describe(const char *arg, int last_one)
392392
if (unannotated_cnt)
393393
die(_("No annotated tags can describe '%s'.\n"
394394
"However, there were unannotated tags: try --tags."),
395-
oid_to_hex(oid));
395+
oid_to_hex(cmit_oid));
396396
else
397397
die(_("No tags can describe '%s'.\n"
398398
"Try --always, or create some tags."),
399-
oid_to_hex(oid));
399+
oid_to_hex(cmit_oid));
400400
}
401401

402402
QSORT(all_matches, match_cnt, compare_pt);

0 commit comments

Comments
 (0)