]> git.feebdaed.xyz Git - 0xmirror/git.git/commit
last-modified: support sparse checkouts
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Sat, 29 Nov 2025 13:43:46 +0000 (13:43 +0000)
committerJunio C Hamano <gitster@pobox.com>
Wed, 3 Dec 2025 22:20:18 +0000 (14:20 -0800)
commit05491b90ce200e6411f9aaac0afe13af45d69824
tree5bd7ffea883e4242d719015189607064f1fbc425
parent9a2fb147f2c61d0cab52c883e7e26f5b7948e3ed
last-modified: support sparse checkouts

In a sparse checkout, a user might want to run `last-modified` on a
directory outside the worktree.

And even in non-sparse checkouts, a user might need to run that command
on a directory that does not exist in the worktree.

These use cases should be supported via the `--` separator between
revision and file arguments, which is even advertised in the
documentation. This patch fixes a tiny bug that prevents that from
working.

This fixes https://github.com/git-for-windows/git/issues/5978

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Acked-by: Derrick Stolee <stolee@gmail.com>
Acked-by: Toon Claes <toon@iotcl.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/last-modified.c
t/t8020-last-modified.sh