From: Junio C Hamano Date: Fri, 27 Jul 2007 06:24:28 +0000 (-0700) Subject: git-stash: do not remove a ref by hand. X-Git-Tag: v1.5.3-rc4~56 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=7ab3cc70;p=git.git 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 --- diff --git a/git-stash.sh b/git-stash.sh index d9cd42d4b..f90dffd4c 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 () {