mirror of
https://github.com/git/git
synced 2024-08-24 18:26:02 +00:00
![Jens Lehmann](/assets/img/avatar_default.png)
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>
25 lines
535 B
Bash
Executable file
25 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
|