aboutsummaryrefslogtreecommitdiff
path: root/git-stash.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 15:24:39 +0700
committerJunio C Hamano <gitster@pobox.com>2014-12-01 11:00:14 -0800
commit337959b491170c13166d7bced07a4c23b7567d27 (patch)
treefa4a4d1e4fc8d62759b0f5d652df2a455734ab00 /git-stash.sh
parentb849b954d22ee069b0edec1a12c78782ae1e629d (diff)
downloadgit-337959b491170c13166d7bced07a4c23b7567d27.tar.gz
git-337959b491170c13166d7bced07a4c23b7567d27.tar.xz
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>
Diffstat (limited to 'git-stash.sh')
-rwxr-xr-xgit-stash.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-stash.sh b/git-stash.sh
index b6d4b06c5..6846b18db 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