diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2018-03-19 23:21:55 +0000 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-03-20 09:08:34 -0700 |
commit | 833622a945a677ec690e5ffb05a637e425591f1d (patch) | |
tree | 91657dc3955a10f1c2986bd7ef3e9a72a5ff8849 /t/t5312-prune-corruption.sh | |
parent | stash: fix nonsense pipeline (diff) | |
download | tgif-833622a945a677ec690e5ffb05a637e425591f1d.tar.xz |
stash push: avoid printing errors
'git stash push -u -- <pathspec>' prints the following errors if
<pathspec> only matches untracked files:
fatal: pathspec 'untracked' did not match any files
error: unrecognized input
This is because we first clean up the untracked files using 'git clean
<pathspec>', and then use a command chain involving 'git add -u
<pathspec>' and 'git apply' to clear the changes to files that are in
the index and were stashed.
As the <pathspec> only includes untracked files that were already
removed by 'git clean', the 'git add' call will barf, and so will 'git
apply', as there are no changes that need to be applied.
Fix this by avoiding the 'git clean' if a pathspec is given, and use the
pipeline that's used for pathspec mode to get rid of the untracked files
as well.
Reported-by: Marc Strapetz <marc.strapetz@syntevo.com>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5312-prune-corruption.sh')
0 files changed, 0 insertions, 0 deletions