git stash: make sure that .git/logs/refs/ exists
authorJohannes Schindelin <johannes.schindelin@gmx.de>
Mon, 27 Aug 2012 18:13:46 +0000 (27 13:13 -0500)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Mon, 22 Oct 2012 12:31:49 +0000 (22 13:31 +0100)
If the user has not activated reflogs, or if nothing has been recorded
yet (as is the case directly after cloning), said directory may not
exist yet.

Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
git-stash.sh

index bbefdf6..b2b3041 100755 (executable)
@@ -229,6 +229,7 @@ save_stash () {
        create_stash "$stash_msg" $untracked
 
        # Make sure the reflog for stash is kept.
+       mkdir -p "$GIT_DIR/logs/${ref_stash%/*}"
        : >>"$GIT_DIR/logs/$ref_stash"
 
        git update-ref -m "$stash_msg" $ref_stash $w_commit ||