1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-05-24 14:16:32 +02:00

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 <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller 2017-11-15 18:00:36 -08:00 committed by Junio C Hamano
parent ce5b6f9be8
commit c87b653c46

View File

@ -381,9 +381,9 @@ static void describe(const char *arg, int last_one)
}
if (!match_cnt) {
struct object_id *oid = &cmit->object.oid;
struct object_id *cmit_oid = &cmit->object.oid;
if (always) {
printf("%s", find_unique_abbrev(oid->hash, abbrev));
printf("%s", find_unique_abbrev(cmit_oid->hash, abbrev));
if (suffix)
printf("%s", suffix);
printf("\n");
@ -392,11 +392,11 @@ static void describe(const char *arg, int last_one)
if (unannotated_cnt)
die(_("No annotated tags can describe '%s'.\n"
"However, there were unannotated tags: try --tags."),
oid_to_hex(oid));
oid_to_hex(cmit_oid));
else
die(_("No tags can describe '%s'.\n"
"Try --always, or create some tags."),
oid_to_hex(oid));
oid_to_hex(cmit_oid));
}
QSORT(all_matches, match_cnt, compare_pt);