]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t9350-fast-export.sh
Merge branch 'en/fetch-negotiation-default-fix'
[thirdparty/git.git] / t / t9350-fast-export.sh
index 409b48e244224629a11ced5d9cbd99fd81f167ae..7b7a18dd2c1e07afe2a129b868bf878020882a1f 100755 (executable)
@@ -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