Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/t3513-revert-submodule.sh # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / t3513-revert-submodule.sh` 35 lines ยท 1007 bytes Raw Blame History 1 #!/bin/sh 2 3 test_description='revert can handle submodules' 4 5 . ./test-lib.sh 6 . "$TEST_DIRECTORY"/lib-submodule-update.sh 7 8 # Create a revert that moves from HEAD (including any test modifications to 9 # the work tree) to $1 by first checking out $1 and reverting it. Reverting 10 # the revert is the transition we test for. We tar the current work tree 11 # first so we can restore the work tree test setup after doing the checkout 12 # and revert. We test here that the restored work tree content is identical 13 # to that at the beginning. The last revert is then tested by the framework. 14 git_revert () { 15 git status -su >expect && 16 ls -1pR * >>expect && 17 "$TAR" cf "$TRASH_DIRECTORY/tmp.tar" * && 18 may_only_be_test_must_fail "$2" && 19 $2 git checkout "$1" && 20 if test -n "$2" 21 then 22 return 23 fi && 24 git revert HEAD && 25 rm -rf * && 26 "$TAR" xf "$TRASH_DIRECTORY/tmp.tar" && 27 git status -su >actual && 28 ls -1pR * >>actual && 29 test_cmp expect actual && 30 git revert HEAD 31 } 32 33 test_submodule_switch_func "git_revert" 34 35 test_done