@matheusbsbs / matheus-bagliano / commits / 7ab3cc70a6
Fork 0

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>

Junio C Hamano committed Jul 26, 2007 at 23:24 UTC 7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f
1 file changed +4 -3
git-stash.sh
+4 -3
@@ -19,9 +19,10 @@ no_changes () {
19 }
20
21 clear_stash () {
22 - logfile="$GIT_DIR/logs/$ref_stash" &&
23 - mkdir -p "$(dirname "$logfile")" &&
24 - : >"$logfile"
22 + if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
23 + then
24 + git update-ref -d refs/stash $current
25 + fi
26 }
27
28 save_stash () {