]> git.ipfire.org Git - thirdparty/git.git/commit
revision: fix --missing=[print|allow*] for annotated tags
authorChristian Couder <christian.couder@gmail.com>
Wed, 28 Feb 2024 09:10:11 +0000 (10:10 +0100)
committerJunio C Hamano <gitster@pobox.com>
Wed, 28 Feb 2024 17:28:18 +0000 (09:28 -0800)
commita4324babe679352a801310f8e30f3cbcd9c1f16b
tree5c392df0c0a7c561d17ebda727d1ab35e67673b0
parent7b644c8c5a67cdda4a15ac91976eb29f5e29b796
revision: fix --missing=[print|allow*] for annotated tags

In 9830926c7d (rev-list: add commit object support in `--missing`
option, 2023-10-27) we fixed the `--missing` option in `git rev-list`
so that it works with missing commits, not just blobs/trees.

Unfortunately, such a command was still failing with a "fatal: bad
object <oid>" if it was passed a missing commit, blob or tree as an
argument (before the rev walking even begins). This was fixed in a
recent commit.

That fix still doesn't work when an argument passed to the command is
an annotated tag pointing to a missing commit though. In that case
`git rev-list --missing=...` still errors out with a "fatal: bad
object <oid>" error where <oid> is the object ID of the missing
commit.

Let's fix this issue, and also, while at it, let's add tests not just
for annotated tags but also for regular tags and branches.

Signed-off-by: Christian Couder <chriscool@tuxfamily.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
revision.c
t/t6022-rev-list-missing.sh