Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion builtin/last-modified.c
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ int cmd_last_modified(int argc, const char **argv, const char *prefix,

argc = parse_options(argc, argv, prefix, last_modified_options,
last_modified_usage,
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT);
PARSE_OPT_KEEP_ARGV0 | PARSE_OPT_KEEP_UNKNOWN_OPT |
PARSE_OPT_KEEP_DASHDASH);

repo_config(repo, git_default_config, NULL);

Expand Down
8 changes: 8 additions & 0 deletions t/t8020-last-modified.sh
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,14 @@ test_expect_success 'last-modified subdir' '
EOF
'

test_expect_success 'last-modified in sparse checkout' '
test_when_finished "git sparse-checkout disable" &&
git sparse-checkout set b &&
check_last_modified -- a <<-\EOF
3 a
EOF
'

test_expect_success 'last-modified subdir recursive' '
check_last_modified -r a <<-\EOF
3 a/b/file
Expand Down
Loading