@matheusbsbs / matheus-bagliano / commits / a9ee9bf9f9
Fork 0

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>

Emil Medve committed Nov 7, 2007 at 15:10 UTC a9ee9bf9f9840498f2369ebafe6c220deb4327fd
1 file changed +5 -1
git-stash.sh
+5 -1
@@ -21,7 +21,7 @@ no_changes () {
21 clear_stash () {
22 if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
23 then
24 - git update-ref -d refs/stash $current
24 + git update-ref -d $ref_stash $current
25 fi
26 }
27
@@ -92,6 +92,10 @@ save_stash () {
92 clear_stash || die "Cannot initialize stash"
93
94 create_stash "$stash_msg"
95 +
96 + # Make sure the reflog for stash is kept.
97 + : >>"$GIT_DIR/logs/$ref_stash"
98 +
99 git update-ref -m "$stash_msg" $ref_stash $w_commit ||
100 die "Cannot save the current status"
101 printf >&2 'Saved "%s"\n' "$stash_msg"