]> git.99rst.org Git - git.git/commit
last-modified: verify revision argument is a commit-ish
authorToon Claes <redacted>
Fri, 30 Jan 2026 14:26:38 +0000 (15:26 +0100)
committerJunio C Hamano <redacted>
Fri, 30 Jan 2026 16:57:01 +0000 (08:57 -0800)
commit525ef52301be231c73393da5af4a4071f060eb20
treed9196ebe8c54c6f4607a82cca5ee6a5b017c6341
parentb768485c4b7ad0a80d0fd24ec941308b57ccb6ed
last-modified: verify revision argument is a commit-ish

Passing a non-committish revision to git-last-modified(1) triggers the
following BUG:

    git last-modified HEAD^{tree}
    BUG: builtin/last-modified.c:456: paths remaining beyond boundary in last-modified

Fix this error by ensuring that the given revision peels to a commit.

This change also adds a test to verify git-last-modified(1) can operate
on an annotated tag. For this an annotated tag is added that points to
the second commit. But this causes ambiguous results when calling
git-name-rev(1) with `--tags`, because now two tags point to the same
commit. To remove this ambiguity, pass `--exclude=<tag>` to
git-name-rev(1) to exclude the new annotated tag.

Reported-by: Gusted <redacted>
Signed-off-by: Toon Claes <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/last-modified.c
t/t8020-last-modified.sh
git clone https://git.99rst.org/PROJECT