Browse Source

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>
maint
Junio C Hamano 18 years ago
parent
commit
7ab3cc70a6
  1. 7
      git-stash.sh

7
git-stash.sh

@ -19,9 +19,10 @@ no_changes () { @@ -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 () {

Loading…
Cancel
Save