]> git.ipfire.org Git - thirdparty/git.git/commit
reflog: don't be noisy on empty reflogs
authorÆvar Arnfjörð Bjarmason <avarab@gmail.com>
Thu, 10 Mar 2022 22:56:11 +0000 (23:56 +0100)
committerJunio C Hamano <gitster@pobox.com>
Sun, 13 Mar 2022 18:37:08 +0000 (18:37 +0000)
commit57be9c6deeb1be7c3ce6270df52473eddc09a86c
tree932d20bfc08710ef9770f666db94bb722639e98b
parentfcd2c3d9d854712e7fbb8e7be5a809029aab0a84
reflog: don't be noisy on empty reflogs

Fix a regression in my daf1d8285ee (reflog expire: don't use
lookup_commit_reference_gently(), 2021-12-22), in changing from
lookup_commit_reference_gently() to lookup_commit() we stopped trying
to call deref_tag() and parse_object() on the provided OID, but we
also started returning non-NULL for the null_oid().

As a result we'd emit an error() via mark_reachable() later in this
function as we tried to invoke parse_commit() on it.

Reported-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Tested-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/reflog.c
t/t1410-reflog.sh