git-stash: Make sure reflog is created for refs/stash
authorしらいしななこ <nanako3@bluebottle.com>
Sat, 28 Jul 2007 01:44:48 +0000 (10:44 +0900)
committerJunio C Hamano <gitster@pobox.com>
Sat, 28 Jul 2007 07:06:00 +0000 (00:06 -0700)
Earlier commit 7ab3cc70 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>
git-stash.sh
index f90dffd4caf88d649a9998a43aee18e57d3f594f..0073e9df5f0e39738107f07919a6f12eafa5ae65 100755 (executable)
@@ -36,6 +36,9 @@ save_stash () {
        test -f "$GIT_DIR/logs/$ref_stash" ||
                clear_stash || die "Cannot initialize stash"
 
+       # Make sure the reflog for stash is kept.
+       : >>"$GIT_DIR/logs/$ref_stash"
+
        # state of the base commit
        if b_commit=$(git rev-parse --verify HEAD)
        then