diff options
author | Ævar Arnfjörð Bjarmason <avarab@gmail.com> | 2021-12-22 05:06:45 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2021-12-22 16:24:13 -0800 |
commit | daf1d8285eeb44eeb8be92b7b01706e887f718ed (patch) | |
tree | 83b0461380ff2c0d181ac477ccc911144730b287 /builtin/reflog.c | |
parent | reflog expire: refactor & use "tip_commit" only for UE_NORMAL (diff) | |
download | tgif-daf1d8285eeb44eeb8be92b7b01706e887f718ed.tar.xz |
reflog expire: don't use lookup_commit_reference_gently()
In the initial implementation of "git reflog" in 4264dc15e19 (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 <avarab@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/reflog.c')
-rw-r--r-- | builtin/reflog.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/builtin/reflog.c b/builtin/reflog.c index f18a63751f..fe0bd35382 100644 --- a/builtin/reflog.c +++ b/builtin/reflog.c @@ -359,8 +359,7 @@ static void reflog_expiry_prepare(const char *refname, if (!cb->cmd.expire_unreachable || is_head(refname)) { cb->unreachable_expire_kind = UE_HEAD; } else { - commit = lookup_commit_reference_gently(the_repository, - oid, 1); + commit = lookup_commit(the_repository, oid); cb->unreachable_expire_kind = commit ? UE_NORMAL : UE_ALWAYS; } |