summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2022-01-10 11:52:50 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2022-01-10 11:52:50 -0800
commit98ab07ace59a5e8ac7a5839e6ef7dc7843996457 (patch)
tree638cffe7055025d1ccba2d9389edea1bbdf0f700 /t
parentMerge branch 'js/l10n-mention-ngettext-early-in-readme' (diff)
parentfast-export: fix surprising behavior with --first-parent (diff)
downloadtgif-98ab07ace59a5e8ac7a5839e6ef7dc7843996457.tar.xz
Merge branch 'ws/fast-export-with-revision-options'
Use of certain "git rev-list" options with "git fast-export" created nonsense results (the worst two of which being "--reverse" and "--invert-grep --grep=<foo>"). The use of "--first-parent" is made to behave a bit more sensible than before. * ws/fast-export-with-revision-options: fast-export: fix surprising behavior with --first-parent
Diffstat (limited to 't')
-rwxr-xr-xt/t9350-fast-export.sh32
1 files changed, 32 insertions, 0 deletions
diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh
index 409b48e244..7b7a18dd2c 100755
--- a/t/t9350-fast-export.sh
+++ b/t/t9350-fast-export.sh
@@ -750,4 +750,36 @@ test_expect_success 'merge commit gets exported with --import-marks' '
)
'
+
+test_expect_success 'fast-export --first-parent outputs all revisions output by revision walk' '
+ git init first-parent &&
+ (
+ cd first-parent &&
+ test_commit A &&
+ git checkout -b topic1 &&
+ test_commit B &&
+ git checkout main &&
+ git merge --no-ff topic1 &&
+
+ git checkout -b topic2 &&
+ test_commit C &&
+ git checkout main &&
+ git merge --no-ff topic2 &&
+
+ test_commit D &&
+
+ git fast-export main -- --first-parent >first-parent-export &&
+ git fast-export main -- --first-parent --reverse >first-parent-reverse-export &&
+ test_cmp first-parent-export first-parent-reverse-export &&
+
+ git init import &&
+ git -C import fast-import <first-parent-export &&
+
+ git log --format="%ad %s" --first-parent main >expected &&
+ git -C import log --format="%ad %s" --all >actual &&
+ test_cmp expected actual &&
+ test_line_count = 4 actual
+ )
+'
+
test_done