Skip to content

Commit e0c4da6

Browse files
szedergitster
authored andcommitted
name-rev: avoid unnecessary cast in name_ref()
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c3794d4 commit e0c4da6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

builtin/name-rev.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ static int name_ref(const char *path, const struct object_id *oid, int flags, vo
272272
int from_tag = starts_with(path, "refs/tags/");
273273

274274
if (taggerdate == TIME_MAX)
275-
taggerdate = ((struct commit *)o)->date;
275+
taggerdate = commit->date;
276276
path = name_ref_abbrev(path, can_abbreviate_output);
277277
name_rev(commit, xstrdup(path), taggerdate, 0, 0,
278278
from_tag, deref);

0 commit comments

Comments
 (0)