mirror of
https://github.com/git/git.git
synced 2024-11-01 06:47:52 +01:00
da7fe3fb6d
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>
24 lines
535 B
Bash
Executable file
24 lines
535 B
Bash
Executable file
#!/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
|