aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2026-02-05 15:42:01 -0800
committerJunio C Hamano <gitster@pobox.com>2026-02-05 15:42:01 -0800
commit7758f84682eb248b8738ea5d9b72e60864fa2ee0 (patch)
tree525c27c12c1901987a6886754a3a9a5fc4d89a41 /t
parent1f17604ce4e35e8a94e73c5c11e5882812663c2f (diff)
parent9dcc09bed13aba0dc93d253f18ee2c7da5970c0c (diff)
downloadgit-7758f84682eb248b8738ea5d9b72e60864fa2ee0.tar.xz
Merge branch 'tc/last-modified-options-cleanup'
The "-z" and "--max-depth" documentation (and implementation of "-z") in the "git last-modified" command have been updated. * tc/last-modified-options-cleanup: last-modified: change default max-depth to 0 last-modified: document option '--max-depth' last-modified: document option '-z' last-modified: clarify in the docs the command takes a pathspec
Diffstat (limited to 't')
-rwxr-xr-xt/t8020-last-modified.sh35
1 files changed, 35 insertions, 0 deletions
diff --git a/t/t8020-last-modified.sh b/t/t8020-last-modified.sh
index 50f4312f71..3944d2e153 100755
--- a/t/t8020-last-modified.sh
+++ b/t/t8020-last-modified.sh
@@ -93,6 +93,41 @@ test_expect_success 'last-modified subdir recursive' '
EOF
'
+test_expect_success 'last-modified subdir non-recursive' '
+ check_last_modified a <<-\EOF
+ 3 a
+ EOF
+'
+
+test_expect_success 'last-modified path in subdir non-recursive' '
+ check_last_modified a/file <<-\EOF
+ 2 a/file
+ EOF
+'
+
+test_expect_success 'last-modified subdir with wildcard non-recursive' '
+ check_last_modified a/* <<-\EOF
+ 3 a/b
+ 2 a/file
+ EOF
+'
+
+test_expect_success 'last-modified with negative max-depth' '
+ check_last_modified --max-depth=-1 <<-\EOF
+ 3 a/b/file
+ 2 a/file
+ 1 file
+ EOF
+'
+
+test_expect_success 'last-modified with max-depth of 1' '
+ check_last_modified --max-depth=1 <<-\EOF
+ 3 a/b
+ 2 a/file
+ 1 file
+ EOF
+'
+
test_expect_success 'last-modified from non-HEAD commit' '
check_last_modified HEAD^ <<-\EOF
2 a