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 Stepan Kasal
parent d4c36517ad
commit 3c8365cf35

View File

@@ -262,6 +262,7 @@ save_stash () {
clear_stash || die "$(gettext "Cannot initialize stash")"
create_stash "$stash_msg" $untracked
mkdir -p "$GIT_DIR/logs/${ref_stash%/*}"
store_stash -m "$stash_msg" -q $w_commit ||
die "$(gettext "Cannot save the current status")"
say Saved working directory and index state "$stash_msg"