git/builtin
Thomas Gummerer 63b50c8ffe 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>
2019-06-19 14:47:49 -07:00
..
2019-04-25 16:41:17 +09:00
2019-04-25 16:41:14 +09:00
2018-05-13 10:45:05 +09:00
2019-01-29 12:47:54 -08:00
2019-04-25 16:41:12 +09:00
2019-05-19 16:45:35 +09:00
2018-10-19 13:34:02 +09:00
2019-03-20 15:16:06 +09:00
2019-04-01 12:51:51 +09:00
2019-02-06 22:05:23 -08:00
2019-02-06 22:05:23 -08:00
2019-01-18 13:49:52 -08:00
2019-03-24 21:35:34 +09:00
2019-05-09 00:37:25 +09:00
2018-05-29 00:28:22 +09:00
2019-05-19 16:45:26 +09:00