summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
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