]> git.ipfire.org Git - thirdparty/git.git/commit
last-modified: verify revision argument is a commit-ish
authorToon Claes <toon@iotcl.com>
Fri, 16 Jan 2026 13:08:40 +0000 (14:08 +0100)
committerJunio C Hamano <gitster@pobox.com>
Fri, 16 Jan 2026 17:30:27 +0000 (09:30 -0800)
commit06643fb8a5e2833823e879c0a6bf3bd54951d43a
treedb171e7b0ed6f6b3dcf82a0854bed5ae757cc3ef
parentbe38275cd8f6ade73c92c52452b78770d5f54f6f
last-modified: verify revision argument is a commit-ish

Passing a tree OID to git-last-modified(1) would trigger BUG behavior.

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

Fix this error by verifying the parsed revision is a commit-ish.

Reported-by: Gusted <gusted@codeberg.org>
Signed-off-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/last-modified.c
t/t8020-last-modified.sh