Skip to content

Commit daf1d82

Browse files
avargitster
authored andcommitted
reflog expire: don't use lookup_commit_reference_gently()
In the initial implementation of "git reflog" in 4264dc1 (git reflog expire, 2006-12-19) we had this lookup_commit_reference_gently(). I don't think we've ever found tags that we need to recursively dereference in reflogs, so this should at least be changed to a "lookup commit" as I'm doing here, although I can't think of a way where it mattered in practice. I also think we'd probably like to just die here if we have a NULL object, but as this code needs to handle potentially broken repositories let's just show an "error" but continue, the non-quiet lookup_commit() will do for us. None of our tests cover the case where "commit" is NULL after this lookup. Signed-off-by: Ævar Arnfjörð Bjarmason <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 07815e2 commit daf1d82

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

builtin/reflog.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -359,8 +359,7 @@ static void reflog_expiry_prepare(const char *refname,
359359
if (!cb->cmd.expire_unreachable || is_head(refname)) {
360360
cb->unreachable_expire_kind = UE_HEAD;
361361
} else {
362-
commit = lookup_commit_reference_gently(the_repository,
363-
oid, 1);
362+
commit = lookup_commit(the_repository, oid);
364363
cb->unreachable_expire_kind = commit ? UE_NORMAL : UE_ALWAYS;
365364
}
366365

0 commit comments

Comments
 (0)