Skip to content

Commit 337959b

Browse files
pcloudsgitster
authored andcommitted
git-stash: avoid hardcoding $GIT_DIR/logs/....
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent b849b95 commit 337959b

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

git-stash.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -184,7 +184,7 @@ store_stash () {
184184
fi
185185

186186
# Make sure the reflog for stash is kept.
187-
: >>"$GIT_DIR/logs/$ref_stash"
187+
: >>"$(git rev-parse --git-path logs/$ref_stash)"
188188
git update-ref -m "$stash_msg" $ref_stash $w_commit
189189
ret=$?
190190
test $ret != 0 && test -z $quiet &&
@@ -259,7 +259,7 @@ save_stash () {
259259
say "$(gettext "No local changes to save")"
260260
exit 0
261261
fi
262-
test -f "$GIT_DIR/logs/$ref_stash" ||
262+
test -f "$(git rev-parse --git-path logs/$ref_stash)" ||
263263
clear_stash || die "$(gettext "Cannot initialize stash")"
264264

265265
create_stash "$stash_msg" $untracked

0 commit comments

Comments
 (0)