summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-02-15 23:18:13 (GMT)
commit984c8337de2e2d610d36426226c08a14b43af23f (patch)
tree22c009a85ad30d35ae2f58475801af1bb774e677 /git-stash.sh
parent1363914a6a4ad013f1cb0189e4ff63a17482bcae (diff)
parentbba067d2faf047597bc76f885fb0cf87894b5ed1 (diff)
downloadgit-984c8337de2e2d610d36426226c08a14b43af23f.zip
git-984c8337de2e2d610d36426226c08a14b43af23f.tar.gz
git-984c8337de2e2d610d36426226c08a14b43af23f.tar.bz2
Merge branch 'tg/stash-with-pathspec-fix' into maint
"git stash -- <pathspec>" incorrectly blew away untracked files in the directory that matched the pathspec, which has been corrected. * tg/stash-with-pathspec-fix: stash: don't delete untracked files that match pathspec
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh5
1 files changed, 2 insertions, 3 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 1114005..fc8f8ae 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -322,10 +322,9 @@ push_stash () {
if test $# != 0
then
- git reset -q -- "$@"
- git ls-files -z --modified -- "$@" |
+ git add -u -- "$@" |
git checkout-index -z --force --stdin
- git clean --force -q -d -- "$@"
+ git diff-index -p --cached --binary HEAD -- "$@" | git apply --index -R
else
git reset --hard -q
fi