forked from git/git
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
- Loading branch information
Showing
2 changed files
with
42 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |