diff options
author | Thomas Gummerer <t.gummerer@gmail.com> | 2019-06-15 12:26:18 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2019-06-19 14:47:49 -0700 |
commit | 63b50c8ffe7133d2ec7d243dd9240c14ddfe8a26 (patch) | |
tree | 140febf05a4e4d8f3fa16d820650a877654788ac /t/t0021-conversion.sh | |
parent | Git 2.22 (diff) | |
download | tgif-63b50c8ffe7133d2ec7d243dd9240c14ddfe8a26.tar.xz |
stash: fix show referencing stash index
In the conversion of 'stash show' to C in dc7bd382b1 ("stash: convert
show to builtin", 2019-02-25), 'git stash show <n>', where n is the
index of a stash got broken, if n is not a file or a valid revision by
itself.
'stash show' accepts any flag 'git diff' accepts for changing the
output format. Internally we use 'setup_revisions()' to parse these
command line flags. Currently we pass the whole argv through to
'setup_revisions()', which includes the stash index.
As the stash index is not a valid revision or a file in the working
tree in most cases however, this 'setup_revisions()' call (and thus
the whole command) ends up failing if we use this form of 'git stash
show'.
Instead of passing the whole argv to 'setup_revisions()', only pass
the flags (and the command name) through, while excluding the stash
reference. The stash reference is parsed (and validated) in
'get_stash_info()' already.
This separate parsing also means that we currently do produce the
correct output if the command succeeds.
Reported-by: Mike Hommey <mh@glandium.org>
Signed-off-by: Thomas Gummerer <t.gummerer@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t0021-conversion.sh')
0 files changed, 0 insertions, 0 deletions