Skip to content

Commit 09a2302

Browse files
committed
Merge branch 'rs/fast-export-pathspec-fix' into maint
"git fast-export -- <pathspec>" lost the pathspec when showing the second and subsequent commits, which has been corrected. source: <[email protected]> * rs/fast-export-pathspec-fix: 2.36 fast-export regression fix
2 parents 8da1481 + d1c2527 commit 09a2302

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

builtin/fast-export.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1261,6 +1261,7 @@ int cmd_fast_export(int argc, const char **argv, const char *prefix)
12611261
revs.diffopt.format_callback = show_filemodify;
12621262
revs.diffopt.format_callback_data = &paths_of_changed_objects;
12631263
revs.diffopt.flags.recursive = 1;
1264+
revs.diffopt.no_free = 1;
12641265
while ((commit = get_revision(&revs)))
12651266
handle_commit(commit, &revs, &paths_of_changed_objects);
12661267

t/t9350-fast-export.sh

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -500,6 +500,13 @@ test_expect_success 'path limiting with import-marks does not lose unmodified fi
500500
grep file0 actual
501501
'
502502

503+
test_expect_success 'path limiting works' '
504+
git fast-export simple -- file >actual &&
505+
sed -ne "s/^M .* //p" <actual | sort -u >actual.files &&
506+
echo file >expect &&
507+
test_cmp expect actual.files
508+
'
509+
503510
test_expect_success 'avoid corrupt stream with non-existent mark' '
504511
test_create_repo avoid_non_existent_mark &&
505512
(

0 commit comments

Comments
 (0)