summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <gitster@pobox.com>2008-01-05 01:35:54 -0800
committerLibravatar Junio C Hamano <gitster@pobox.com>2008-01-06 18:41:36 -0800
commit3023dc690f98f83b64cc6f2a9cc015bf2b01964a (patch)
tree9f56b0da7a3c138bb00036a63d53ba281f3d9ed6
parentgit-stash: use stdout instead of stderr for non error messages (diff)
downloadtgif-3023dc690f98f83b64cc6f2a9cc015bf2b01964a.tar.xz
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: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xgit-stash.sh7
1 files changed, 6 insertions, 1 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 4d5e5c0be7..b00f888169 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -20,6 +20,10 @@ no_changes () {
}
clear_stash () {
+ if test $# != 0
+ then
+ die "git stash clear with parameters is unimplemented"
+ fi
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
then
git update-ref -d $ref_stash $current
@@ -216,7 +220,8 @@ apply)
apply_stash "$@"
;;
clear)
- clear_stash
+ shift
+ clear_stash "$@"
;;
create)
if test $# -gt 0 && test "$1" = create