git-stash: Fix listing stashes

Commit bc9e7399af "reverted" commit
f12e925ac2

Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Emil Medve 2007-11-07 15:10:27 -06:00 committed by Junio C Hamano
parent a64d7784e8
commit a9ee9bf9f9

View file

@ -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"