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>
This commit is contained in:
Junio C Hamano 2007-07-26 23:24:28 -07:00
parent 383e45cec4
commit 7ab3cc70a6

View File

@ -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 () {