Skip to content

Commit a9ee9bf

Browse files
Emil Medvegitster
authored andcommitted
git-stash: Fix listing stashes
Commit bc9e739 "reverted" commit f12e925 Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent a64d778 commit a9ee9bf

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

git-stash.sh

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ no_changes () {
2121
clear_stash () {
2222
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
2323
then
24-
git update-ref -d refs/stash $current
24+
git update-ref -d $ref_stash $current
2525
fi
2626
}
2727

@@ -92,6 +92,10 @@ save_stash () {
9292
clear_stash || die "Cannot initialize stash"
9393

9494
create_stash "$stash_msg"
95+
96+
# Make sure the reflog for stash is kept.
97+
: >>"$GIT_DIR/logs/$ref_stash"
98+
9599
git update-ref -m "$stash_msg" $ref_stash $w_commit ||
96100
die "Cannot save the current status"
97101
printf >&2 'Saved "%s"\n' "$stash_msg"

0 commit comments

Comments
 (0)