]> git.ipfire.org Git - thirdparty/git.git/commitdiff
name-rev: avoid unnecessary cast in name_ref()
authorSZEDER Gábor <szeder.dev@gmail.com>
Tue, 12 Nov 2019 10:38:12 +0000 (11:38 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 6 Dec 2019 21:29:04 +0000 (13:29 -0800)
Casting a 'struct object' to 'struct commit' is unnecessary there,
because it's already available in the local 'commit' variable.

Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/name-rev.c

index 15919adbdbe48a4126af0ed62630a5738105c4ed..e40f51c2b4af414f225da5099967d6605b67d7da 100644 (file)
@@ -272,7 +272,7 @@ static int name_ref(const char *path, const struct object_id *oid, int flags, vo
                int from_tag = starts_with(path, "refs/tags/");
 
                if (taggerdate == TIME_MAX)
-                       taggerdate = ((struct commit *)o)->date;
+                       taggerdate = commit->date;
                path = name_ref_abbrev(path, can_abbreviate_output);
                name_rev(commit, xstrdup(path), taggerdate, 0, 0,
                         from_tag, deref);