]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-stash.sh
Sync with 2.15.3
[thirdparty/git.git] / git-stash.sh
index 1114005ce2829011cde2e6de608a2b90df355fc9..fc8f8ae6401dddcceaa82f9e9c748f5c185536d6 100755 (executable)
@@ -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