From: Nguyễn Thái Ngọc Duy Date: Sun, 30 Nov 2014 08:24:39 +0000 (+0700) Subject: git-stash: avoid hardcoding $GIT_DIR/logs/.... X-Git-Tag: v2.5.0-rc0~143^2~27 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=337959b491170c13166d7bced07a4c23b7567d27;p=thirdparty%2Fgit.git git-stash: avoid hardcoding $GIT_DIR/logs/.... Signed-off-by: Nguyễn Thái Ngọc Duy Signed-off-by: Junio C Hamano --- diff --git a/git-stash.sh b/git-stash.sh index b6d4b06c5f..6846b18dbc 100755 --- a/git-stash.sh +++ b/git-stash.sh @@ -184,7 +184,7 @@ store_stash () { fi # Make sure the reflog for stash is kept. - : >>"$GIT_DIR/logs/$ref_stash" + : >>"$(git rev-parse --git-path logs/$ref_stash)" git update-ref -m "$stash_msg" $ref_stash $w_commit ret=$? test $ret != 0 && test -z $quiet && @@ -259,7 +259,7 @@ save_stash () { say "$(gettext "No local changes to save")" exit 0 fi - test -f "$GIT_DIR/logs/$ref_stash" || + test -f "$(git rev-parse --git-path logs/$ref_stash)" || clear_stash || die "$(gettext "Cannot initialize stash")" create_stash "$stash_msg" $untracked