]> git.ipfire.org Git - thirdparty/git.git/commitdiff
t1092: add cherry-pick, rebase tests
authorDerrick Stolee <dstolee@microsoft.com>
Wed, 8 Sep 2021 11:23:59 +0000 (11:23 +0000)
committerJunio C Hamano <gitster@pobox.com>
Thu, 9 Sep 2021 22:49:04 +0000 (15:49 -0700)
Add tests to check that cherry-pick and rebase behave the same in the
sparse-index case as in the full index cases. These tests are agnostic
to GIT_TEST_MERGE_ALGORITHM, so a full CI test suite will check both the
'ort' and 'recursive' strategies on this test.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Reviewed-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
t/t1092-sparse-checkout-compatibility.sh

index 36964f52f2f1b656f5de9061610f5ec5615ff46d..d9424ed6427cb3b8d7a932c094397491aa93f844 100755 (executable)
@@ -481,14 +481,17 @@ test_expect_success 'checkout and reset (mixed) [sparse]' '
        test_sparse_match git reset update-folder2
 '
 
-test_expect_success 'merge' '
+test_expect_success 'merge, cherry-pick, and rebase' '
        init_repos &&
 
-       test_all_match git checkout -b merge update-deep &&
-       test_all_match git merge -m "folder1" update-folder1 &&
-       test_all_match git rev-parse HEAD^{tree} &&
-       test_all_match git merge -m "folder2" update-folder2 &&
-       test_all_match git rev-parse HEAD^{tree}
+       for OPERATION in "merge -m merge" cherry-pick rebase
+       do
+               test_all_match git checkout -B temp update-deep &&
+               test_all_match git $OPERATION update-folder1 &&
+               test_all_match git rev-parse HEAD^{tree} &&
+               test_all_match git $OPERATION update-folder2 &&
+               test_all_match git rev-parse HEAD^{tree} || return 1
+       done
 '
 
 # NEEDSWORK: This test is documenting current behavior, but that