cherry-pick: add t3512 for submodule updates
[gitweb.git] / t / lib-submodule-update.sh
index 759dbe614c35a44af652c0b59e49f27715831144..d499b2752e6ad4f4da6806f172d1c6ec7094aa57 100755 (executable)
@@ -402,7 +402,16 @@ test_submodule_switch () {
 
        ########################## Modified submodule #########################
        # Updating a submodule sha1 doesn't update the submodule's work tree
-       test_expect_success "$command: modified submodule does not update submodule work tree" '
+       if test "$KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT" = 1
+       then
+               # When cherry picking a SHA-1 update for an ignored submodule
+               # the commit incorrectly fails with "The previous cherry-pick
+               # is now empty, possibly due to conflict resolution."
+               RESULT="failure"
+       else
+               RESULT="success"
+       fi
+       test_expect_$RESULT "$command: modified submodule does not update submodule work tree" '
                prolog &&
                reset_work_tree_to add_sub1 &&
                (
@@ -418,7 +427,7 @@ test_submodule_switch () {
 
        # Updating a submodule to an invalid sha1 doesn't update the
        # submodule's work tree, subsequent update will fail
-       test_expect_success "$command: modified submodule does not update submodule work tree to invalid commit" '
+       test_expect_$RESULT "$command: modified submodule does not update submodule work tree to invalid commit" '
                prolog &&
                reset_work_tree_to add_sub1 &&
                (
@@ -433,7 +442,7 @@ test_submodule_switch () {
        '
        # Updating a submodule from an invalid sha1 doesn't update the
        # submodule's work tree, subsequent update will succeed
-       test_expect_success "$command: modified submodule does not update submodule work tree from invalid commit" '
+       test_expect_$RESULT "$command: modified submodule does not update submodule work tree from invalid commit" '
                prolog &&
                reset_work_tree_to invalid_sub1 &&
                (