diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2017-03-21 23:12:18 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2017-03-22 22:55:55 +0100 |
commit | 869fb8f729a4e3486ea3c37820e97548223fac6a (patch) | |
tree | 653b24baa373b033a32e55c2540e285d199d3d3b /t/t3904-stash-patch.sh | |
parent | stash: don't show internal implementation details (diff) | |
download | git-869fb8f729a4e3486ea3c37820e97548223fac6a.tar.xz git-869fb8f729a4e3486ea3c37820e97548223fac6a.zip |
stash: pass the pathspec argument to git reset
For "git stash -p --no-keep-index", the pathspec argument is currently
not passed to "git reset". This means that changes that are staged but
that are excluded from the pathspec still get unstaged by git stash -p.
Make sure that doesn't happen by passing the pathspec argument to the
git reset in question, bringing the behaviour in line with "git stash --
<pathspec>".
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Reviewed-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3904-stash-patch.sh')
-rwxr-xr-x | t/t3904-stash-patch.sh | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/t/t3904-stash-patch.sh b/t/t3904-stash-patch.sh index 38e730090f..83744f8c93 100755 --- a/t/t3904-stash-patch.sh +++ b/t/t3904-stash-patch.sh @@ -77,6 +77,14 @@ test_expect_success 'git stash --no-keep-index -p' ' verify_state dir/foo work index ' +test_expect_success 'stash -p --no-keep-index -- <pathspec> does not unstage other files' ' + set_state HEAD HEADfile_work HEADfile_index && + set_state dir/foo work index && + echo y | git stash push -p --no-keep-index -- HEAD && + verify_state HEAD committed committed && + verify_state dir/foo work index +' + test_expect_success 'none of this moved HEAD' ' verify_saved_head ' |