Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2018-01-24 00:16:39 +0300
committerJunio C Hamano <gitster@pobox.com>2018-01-24 00:16:39 +0300
commit087d1a8e9c49e5c11008582e92f346680d0d8c89 (patch)
treedd235b2a555cc10a37906ae9bd58abc5e23360f6 /git-stash.sh
parentf0605836b7411e700e980122f684d7e788e33a3f (diff)
parentbba067d2faf047597bc76f885fb0cf87894b5ed1 (diff)
Merge branch 'tg/stash-with-pathspec-fix'
"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 1114005ce2..fc8f8ae640 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