summaryrefslogtreecommitdiff
path: root/git-rebase.sh
diff options
context:
space:
mode:
authorNguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 15:24:38 +0700
committerJunio C Hamano <gitster@pobox.com>2014-12-01 11:00:13 -0800
commitb849b954d22ee069b0edec1a12c78782ae1e629d (patch)
treec5f3d71a51a6c0f356f496228b0c72358c5269a2 /git-rebase.sh
parent3bc518084acfdbc81a656c9cdff1f1bd50e0615f (diff)
downloadgit-b849b954d22ee069b0edec1a12c78782ae1e629d.tar.gz
*.sh: avoid hardcoding $GIT_DIR/hooks/...
If $GIT_COMMON_DIR is set, it should be $GIT_COMMON_DIR/hooks/, not $GIT_DIR/hooks/. Just let rev-parse --git-path handle it. 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-rebase.sh')
-rwxr-xr-xgit-rebase.sh4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-rebase.sh b/git-rebase.sh
index 55da9db818..fb935a03f3 100755
--- a/git-rebase.sh
+++ b/git-rebase.sh
@@ -202,9 +202,9 @@ run_specific_rebase () {
run_pre_rebase_hook () {
if test -z "$ok_to_skip_pre_rebase" &&
- test -x "$GIT_DIR/hooks/pre-rebase"
+ test -x "$(git rev-parse --git-path hooks/pre-rebase)"
then
- "$GIT_DIR/hooks/pre-rebase" ${1+"$@"} ||
+ "$(git rev-parse --git-path hooks/pre-rebase)" ${1+"$@"} ||
die "$(gettext "The pre-rebase hook refused to rebase.")"
fi
}