Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2007-07-27 10:24:28 +0400
committerJunio C Hamano <gitster@pobox.com>2007-07-27 10:24:28 +0400
commit7ab3cc70a6aad2e4f8ccaa98e5520aa126eaef8f (patch)
tree8a37db98f1f68d18b91a1cdd71ea82b93b080e74 /git-stash.sh
parent383e45cec40a0b881e59e44e011c410218ef476a (diff)
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>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/git-stash.sh b/git-stash.sh
index d9cd42d4b3..f90dffd4ca 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 () {