]> git.ipfire.org Git - thirdparty/git.git/commitdiff
git-stash: do not remove a ref by hand.
authorJunio C Hamano <gitster@pobox.com>
Fri, 27 Jul 2007 06:24:28 +0000 (23:24 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 27 Jul 2007 06:24:28 +0000 (23:24 -0700)
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>
git-stash.sh

index d9cd42d4b34d7ea938131deba305ae9ef636ec7b..f90dffd4caf88d649a9998a43aee18e57d3f594f 100755 (executable)
@@ -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 () {