Imported Upstream version 2.28.0
[platform/upstream/git.git] / t / t3513-revert-submodule.sh
index 5e39fcd..a759f12 100755 (executable)
@@ -15,7 +15,12 @@ git_revert () {
        git status -su >expect &&
        ls -1pR * >>expect &&
        tar cf "$TRASH_DIRECTORY/tmp.tar" * &&
-       git checkout "$1" &&
+       may_only_be_test_must_fail "$2" &&
+       $2 git checkout "$1" &&
+       if test -n "$2"
+       then
+               return
+       fi &&
        git revert HEAD &&
        rm -rf * &&
        tar xf "$TRASH_DIRECTORY/tmp.tar" &&
@@ -26,6 +31,6 @@ git_revert () {
 }
 
 KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
-test_submodule_switch "git_revert"
+test_submodule_switch_func "git_revert"
 
 test_done