aboutsummaryrefslogtreecommitdiff
path: root/t/t3906-stash-submodule.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2014-06-19 22:12:54 +0200
committerJunio C Hamano <gitster@pobox.com>2014-07-14 12:06:16 -0700
commitda7fe3fb6d810507bef586e76a01bb34758d4472 (patch)
treed793ca7dd731958d727be4a2de7e804b6081febd /t/t3906-stash-submodule.sh
parent23e2f388c7da3cfe72c880e662dafb0c2965abba (diff)
downloadgit-da7fe3fb6d810507bef586e76a01bb34758d4472.tar.gz
git-da7fe3fb6d810507bef586e76a01bb34758d4472.tar.xz
stash: add t3906 for submodule updates
Test that the stash apply command updates the work tree as expected for changes which don't result in conflicts. To make that work add a helper function that uses read-tree to apply the changes of the target commit to the work tree, then stashes these changes and at last applies that stash. Implement the KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES switch and reuse two other already present switches to expect the known failure that stash does ignore submodule changes. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3906-stash-submodule.sh')
-rwxr-xr-xt/t3906-stash-submodule.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3906-stash-submodule.sh b/t/t3906-stash-submodule.sh
new file mode 100755
index 000000000..d7219d6f8
--- /dev/null
+++ b/t/t3906-stash-submodule.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+test_description='stash apply can handle submodules'
+
+. ./test-lib.sh
+. "$TEST_DIRECTORY"/lib-submodule-update.sh
+
+git_stash () {
+ git status -su >expect &&
+ ls -1pR * >>expect &&
+ git read-tree -u -m "$1" &&
+ git stash &&
+ git status -su >actual &&
+ ls -1pR * >>actual &&
+ test_cmp expect actual &&
+ git stash apply
+}
+
+KNOWN_FAILURE_STASH_DOES_IGNORE_SUBMODULE_CHANGES=1
+KNOWN_FAILURE_CHERRY_PICK_SEES_EMPTY_COMMIT=1
+KNOWN_FAILURE_NOFF_MERGE_DOESNT_CREATE_EMPTY_SUBMODULE_DIR=1
+test_submodule_switch "git_stash"
+
+test_done