summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-stash.sh b/git-stash.sh
index d9cd42d4b3..f90dffd4ca 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -19,9 +19,10 @@ no_changes () {
}
clear_stash () {
- logfile="$GIT_DIR/logs/$ref_stash" &&
- mkdir -p "$(dirname "$logfile")" &&
- : >"$logfile"
+ if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
+ then
+ git update-ref -d refs/stash $current
+ fi
}
save_stash () {