Skip to content

Commit 2178707

Browse files
committed
Merge branch 'js/last-modified-with-sparse-checkouts'
"git last-modified" used to mishandle "--" to mark the beginning of pathspec, which has been corrected. * js/last-modified-with-sparse-checkouts: last-modified: support sparse checkouts
2 parents 84ca5a2 + 05491b9 commit 2178707

File tree

2 files changed

+10
-1
lines changed

2 files changed

+10
-1
lines changed

builtin/last-modified.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -525,7 +525,8 @@ int cmd_last_modified(int argc, const char **argv, const char *prefix,
525525

526526
argc = parse_options(argc, argv, prefix, last_modified_options,
527527
last_modified_usage,
528-
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);
528+
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
529+
PARSE_OPT_KEEP_DASHDASH);
529530

530531
repo_config(repo, git_default_config, NULL);
531532

t/t8020-last-modified.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,14 @@ test_expect_success 'last-modified subdir' '
7878
EOF
7979
'
8080

81+
test_expect_success 'last-modified in sparse checkout' '
82+
test_when_finished "git sparse-checkout disable" &&
83+
git sparse-checkout set b &&
84+
check_last_modified -- a <<-\EOF
85+
3 a
86+
EOF
87+
'
88+
8189
test_expect_success 'last-modified subdir recursive' '
8290
check_last_modified -r a <<-\EOF
8391
3 a/b/file

0 commit comments

Comments
 (0)