summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-07-27 06:24:28 (GMT)
committerJunio C Hamano <gitster@pobox.com>2007-07-27 06:24:28 (GMT)
commit7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f (patch)
tree8a37db98f1f68d18b91a1cdd71ea82b93b080e74 /git-stash.sh
parent383e45cec40a0b881e59e44e011c410218ef476a (diff)
downloadgit-7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f.zip
git-7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f.tar.gz
git-7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f.tar.bz2
git-stash: do not remove a ref by hand.
Somebody on #git noticed that "git stash clear" left a packed ref behind for ref/stash. Signed-off-by: Junio C Hamano <gitster@pobox.com>
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 d9cd42d..f90dffd 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 () {