git-commit-vandalism/t/t3906-stash-submodule.sh
Jens Lehmann da7fe3fb6d 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>
2014-07-14 12:06:16 -07:00

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