Skip to content

Commit f12e925

Browse files
しらいしななこgitster
authored andcommitted
git-stash: Make sure reflog is created for refs/stash
Earlier commit 7ab3cc7 fixed "stash clear" but broke save_stash, because it forgot to make sure the reflog file exists before saving. Signed-off-by: Nanako Shiraishi <nanako3@bluebottle.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 11bb2d4 commit f12e925

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

git-stash.sh

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,9 @@ save_stash () {
3636
test -f "$GIT_DIR/logs/$ref_stash" ||
3737
clear_stash || die "Cannot initialize stash"
3838

39+
# Make sure the reflog for stash is kept.
40+
: >>"$GIT_DIR/logs/$ref_stash"
41+
3942
# state of the base commit
4043
if b_commit=$(git rev-parse --verify HEAD)
4144
then

0 commit comments

Comments
 (0)