Commit 3023dc69 authored by Junio C Hamano's avatar Junio C Hamano

git-stash clear: refuse to work with extra parameter for now

Because it is so tempting to expect "git stash clear stash@{4}"
to remove the fourth element in the stash while leaving other
elements intact, we should not blindly throw away everything
upon seeing such a command.

This may change when we start using "git reflog delete" to
selectively nuke a single (or multiple, for that matter) stash
entries with such a command line.
Signed-off-by: default avatarJunio C Hamano <>
parent 7c390d90
......@@ -20,6 +20,10 @@ no_changes () {
clear_stash () {
if test $# != 0
die "git stash clear with parameters is unimplemented"
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
git update-ref -d $ref_stash $current
......@@ -216,7 +220,8 @@ apply)
apply_stash "$@"
clear_stash "$@"
if test $# -gt 0 && test "$1" = create
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment