git-stash: Fix listing stashes
Commitmaintbc9e7399af
"reverted" commitf12e925ac2
Signed-off-by: Emil Medve <Emilian.Medve@Freescale.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
parent
a64d7784e8
commit
a9ee9bf9f9
|
@ -21,7 +21,7 @@ no_changes () {
|
||||||
clear_stash () {
|
clear_stash () {
|
||||||
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
|
if current=$(git rev-parse --verify $ref_stash 2>/dev/null)
|
||||||
then
|
then
|
||||||
git update-ref -d refs/stash $current
|
git update-ref -d $ref_stash $current
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -92,6 +92,10 @@ save_stash () {
|
||||||
clear_stash || die "Cannot initialize stash"
|
clear_stash || die "Cannot initialize stash"
|
||||||
|
|
||||||
create_stash "$stash_msg"
|
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 ||
|
git update-ref -m "$stash_msg" $ref_stash $w_commit ||
|
||||||
die "Cannot save the current status"
|
die "Cannot save the current status"
|
||||||
printf >&2 'Saved "%s"\n' "$stash_msg"
|
printf >&2 'Saved "%s"\n' "$stash_msg"
|
||||||
|
|
Loading…
Reference in New Issue