From: Johannes Schindelin Date: Mon, 27 Aug 2012 18:13:46 +0000 (-0500) Subject: git stash: make sure that .git/logs/refs/ exists X-Git-Url: https://repo.or.cz/w/git/dscho.git/commitdiff_plain/8c61c4c6cd4d8079a80cdd07b3bb21ac9a7e268e git stash: make sure that .git/logs/refs/ exists 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 --- diff --git a/git-stash.sh b/git-stash.sh index bbefdf6424..b2b30410c0 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -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 ||