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>
Nguyễn Thái Ngọc Duy committed
Nov 30, 2014 at 15:24 UTC
337959b491170c13166d7bced07a4c23b7567d27
1 file changed
+2
-2
git-stash.sh
+2
-2
@@ -184,7 +184,7 @@ store_stash () {
184
fi
185
186
# Make sure the reflog for stash is kept.
187
- : >>"$GIT_DIR/logs/$ref_stash"
187
+ : >>"$(git rev-parse --git-path logs/$ref_stash)"
188
git update-ref -m "$stash_msg" $ref_stash $w_commit
189
ret=$?
190
test $ret != 0 && test -z $quiet &&
@@ -259,7 +259,7 @@ save_stash () {
259
say "$(gettext "No local changes to save")"
260
exit 0
261
fi
262
- test -f "$GIT_DIR/logs/$ref_stash" ||
262
+ test -f "$(git rev-parse --git-path logs/$ref_stash)" ||
263
clear_stash || die "$(gettext "Cannot initialize stash")"
264
265
create_stash "$stash_msg" $untracked