Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2015-05-20 21:01:32 +0300
committerJunio C Hamano <gitster@pobox.com>2015-05-20 23:47:30 +0300
commitd6cc2df5c80dc4f52a56679baa5e32539eb028b1 (patch)
tree14ef08830713ebc424ea56bb8abfcb99602120ce /t/t3903-stash.sh
parentfdf96a20acf96a6ac538df8113b2aafd6ed71d50 (diff)
stash: complain about unknown flags
The option parser for git-stash stuffs unknown flags into the $FLAGS variable, where they can be accessed by the individual commands. However, most commands do not even look at these extra flags, leading to unexpected results like this: $ git stash drop --help Dropped refs/stash@{0} (e6cf6d80faf92bb7828f7b60c47fc61c03bd30a1) We should notice the extra flags and bail. Rather than annotate each command to reject a non-empty $FLAGS variable, we can notice that "stash show" is the only command that actually _wants_ arbitrary flags. So we switch the default mode to reject unknown flags, and let stash_show() opt into the feature. Reported-by: Vincent Legoll <vincent.legoll@gmail.com> Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3903-stash.sh')
-rwxr-xr-xt/t3903-stash.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t3903-stash.sh b/t/t3903-stash.sh
index 1e29962fad..384678953e 100755
--- a/t/t3903-stash.sh
+++ b/t/t3903-stash.sh
@@ -93,6 +93,10 @@ test_expect_success 'unstashing in a subdirectory' '
)
'
+test_expect_success 'stash drop complains of extra options' '
+ test_must_fail git stash drop --foo
+'
+
test_expect_success 'drop top stash' '
git reset --hard &&
git stash list > stashlist1 &&