Re: [PATCH 3/3] stash: reject stash name starting with a dash.
- From
Jeff King <peff@peff.net>
- Date
- Aug 19, 2009, 09:57 UTC
- Message-ID
- <20090819095716.GA28920@sigill.intra.peff.net>
- In-Reply-To
- <vpq8whg1ebi.fsf@bauges.imag.fr>
On Wed, Aug 19, 2009 at 08:57:05AM +0200, Matthieu Moy wrote:
Show 17 quoted lines
> >> +test_expect_success 'stash --invalid-option' ' > >> + echo bar5 > file && > >> + echo bar6 > file2 && > >> + git add file2 && > >> + ! git stash --invalid-option && > >> + test bar5,bar6 = $(cat file),$(cat file2) && > >> + git stash -- -message-starting-with-dash && > >> + test bar,bar2 = $(cat file),$(cat file2) > >> +' > > > > Should this actually be "git stash save --invalid-option", since it is > > really testing the actual save option parsing, and not the behavior to > > automatically push options to "git stash save"? > > It could be, but the most annoying DWIM would be the "implicit save" > case, so that's the one I'm testing. One could test both, but that'd > probably be a bit overkill.
But if your proposal to accept any "-*' is not accepted, then it is not testing your added code at all, is it? Even without the rest of the patch, the test would pass.
-Peff