X-Git-Url: https://asedeno.scripts.mit.edu/gitweb/?a=blobdiff_plain;f=git-stash.sh;h=2d691963934c31242512bd4dd349d970c0350243;hb=0901d5a2ef80996cf64c8afeaec765e1bc09f795;hp=3a0685f1893098e8f5c877f509183c8434e7c028;hpb=df248216fd0602e06d3b441e46efa6c74b94d081;p=git.git diff --git a/git-stash.sh b/git-stash.sh index 3a0685f18..2d6919639 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -221,6 +221,7 @@ show_stash () { } apply_stash () { + applied_stash= unstash_index= while test $# != 0 @@ -242,6 +243,9 @@ apply_stash () { if test $# = 0 then have_stash || die 'Nothing to apply' + applied_stash="$ref_stash@{0}" + else + applied_stash="$*" fi # stash records the work tree, and is a merge between the @@ -415,8 +419,7 @@ pop) shift if apply_stash "$@" then - test -z "$unstash_index" || shift - drop_stash "$@" + drop_stash "$applied_stash" fi ;; branch)