summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Beller <sbeller@google.com>2017-11-15 18:00:36 -0800
committerJunio C Hamano <gitster@pobox.com>2017-11-16 11:12:51 +0900
commitc87b653c46c4455561642b14efc8920a0b3e44b9 (patch)
tree48f4a6d339943839d5806a8f91451e796116ca40
parentce5b6f9be84690ba38eba10c42b3f7c7e2511abb (diff)
downloadgit-c87b653c46c4455561642b14efc8920a0b3e44b9.tar.gz
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>
-rw-r--r--builtin/describe.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/builtin/describe.c b/builtin/describe.c
index 29075dbd0f..fd61f463cf 100644
--- a/builtin/describe.c
+++ b/builtin/describe.c
@@ -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);