about summary refs log tree commit diff
path: root/third_party/git/t/t3513-revert-submodule.sh
diff options
context:
space:
mode:
Diffstat (limited to 'third_party/git/t/t3513-revert-submodule.sh')
-rwxr-xr-xthird_party/git/t/t3513-revert-submodule.sh9
1 files changed, 7 insertions, 2 deletions
diff --git a/third_party/git/t/t3513-revert-submodule.sh b/third_party/git/t/t3513-revert-submodule.sh
index 5e39fcdb66c0..a759f12cbb1d 100755
--- a/third_party/git/t/t3513-revert-submodule.sh
+++ b/third_party/git/t/t3513-revert-submodule.sh
@@ -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