summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh12
1 files changed, 8 insertions, 4 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 750f360..ac4c0f6 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -423,6 +423,13 @@ apply_stash () {
fi
}
+pop_stash() {
+ assert_stash_ref "$@"
+
+ apply_stash "$@" &&
+ drop_stash "$@"
+}
+
drop_stash () {
assert_stash_ref "$@"
@@ -498,10 +505,7 @@ drop)
;;
pop)
shift
- if apply_stash "$@"
- then
- drop_stash "$applied_stash"
- fi
+ pop_stash "$@"
;;
branch)
shift