summaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorEmil Medve <Emilian.Medve@Freescale.com>2007-11-07 15:10:27 -0600
committerJunio C Hamano <gitster@pobox.com>2007-11-07 14:00:12 -0800
commita9ee9bf9f9840498f2369ebafe6c220deb4327fd (patch)
tree09fa3df481c8e34abe1a65833e7df97013285907 /git-stash.sh
parenta64d7784e830b3140e7d0f2b45cb3d8fafb84cca (diff)
downloadgit-a9ee9bf9f9840498f2369ebafe6c220deb4327fd.tar.gz
git-stash: Fix listing stashes
Commit bc9e7399af3790918140c30a5b2c85bf9a8f1ad3 "reverted" commit f12e925ac23ad6169e046cfe05b8438a1611ad58 Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/git-stash.sh b/git-stash.sh
index 04af892531..696b465b7c 100755
--- a/git-stash.sh
+++ b/git-stash.sh
@@ -21,7 +21,7 @@ no_changes () {
clear_stash () {
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
then
- git update-ref -d refs/stash $current
+ git update-ref -d $ref_stash $current
fi
}
@@ -92,6 +92,10 @@ save_stash () {
clear_stash || die "Cannot initialize stash"
create_stash "$stash_msg"
+
+ # Make sure the reflog for stash is kept.
+ : >>"$GIT_DIR/logs/$ref_stash"
+
git update-ref -m "$stash_msg" $ref_stash $w_commit ||
die "Cannot save the current status"
printf >&2 'Saved "%s"\n' "$stash_msg"