An earlier change
bba067d2 ("stash: don't delete untracked files
that match pathspec", 2018-01-06) was made by taking a suggestion in
a list discussion [1] but did not copy the suggested snippet
correctly. And the bug was unnoticed during the review and slipped
through.
This fixes it.
[1] https://public-inbox.org/git/xmqqpo7byjwb.fsf@gitster.mtv.corp.google.com/
Signed-off-by: Junio C Hamano <gitster@pobox.com>
if test $# != 0
then
- git add -u -- "$@" |
- git checkout-index -z --force --stdin
- git diff-index -p --cached --binary HEAD -- "$@" | git apply --index -R
+ git add -u -- "$@"
+ git diff-index -p --cached --binary HEAD -- "$@" |
+ git apply --index -R
else
git reset --hard -q
fi