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 <johannes.schindelin@gmx.de>
This commit is contained in:
Johannes Schindelin
2012-08-27 13:13:46 -05:00
committed by Pat Thoyts
parent ebef08522f
commit b788948b2c

View File

@@ -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 ||