stash: handle specifying stashes with $IFS
authorØystein Walle <oystwa@gmail.com>
Tue, 7 Jan 2014 08:22:15 +0000 (09:22 +0100)
committerJunio C Hamano <gitster@pobox.com>
Tue, 7 Jan 2014 18:51:04 +0000 (10:51 -0800)
When trying to pop/apply a stash specified with an argument
containing IFS whitespace, git-stash will throw an error:

$ git stash pop 'stash@{two hours ago}'
Too many revisions specified: stash@{two hours ago}

This happens because word splitting is used to count non-option
arguments. Make use of rev-parse's --sq option to quote the arguments
for us to ensure a correct count. Add quotes where necessary.

Also add a test that verifies correct behaviour.

Helped-by: Thomas Rast <tr@thomasrast.ch>
Signed-off-by: Øystein Walle <oystwa@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
No differences found