From 8c61c4c6cd4d8079a80cdd07b3bb21ac9a7e268e Mon Sep 17 00:00:00 2001 From: Johannes Schindelin Date: Mon, 27 Aug 2012 13:13:46 -0500 Subject: [PATCH] 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 --- git-stash.sh | 1 + 1 file changed, 1 insertion(+) 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 || -- 2.11.4.GIT