summaryrefslogtreecommitdiff
path: root/git-rebase--merge.sh
diff options
context:
space:
mode:
authorLibravatar Nguyễn Thái Ngọc Duy <pclouds@gmail.com>2014-11-30 15:24:38 +0700
committerLibravatar Junio C Hamano <gitster@pobox.com>2014-12-01 11:00:13 -0800
commitb849b954d22ee069b0edec1a12c78782ae1e629d (patch)
treec5f3d71a51a6c0f356f496228b0c72358c5269a2 /git-rebase--merge.sh
parentgit-sh-setup.sh: use rev-parse --git-path to get $GIT_DIR/objects (diff)
downloadtgif-b849b954d22ee069b0edec1a12c78782ae1e629d.tar.xz
*.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--merge.sh')
-rw-r--r--git-rebase--merge.sh6
1 files changed, 2 insertions, 4 deletions
diff --git a/git-rebase--merge.sh b/git-rebase--merge.sh
index d3fb67d75b..2cc2a6d273 100644
--- a/git-rebase--merge.sh
+++ b/git-rebase--merge.sh
@@ -94,10 +94,8 @@ finish_rb_merge () {
if test -s "$state_dir"/rewritten
then
git notes copy --for-rewrite=rebase <"$state_dir"/rewritten
- if test -x "$GIT_DIR"/hooks/post-rewrite
- then
- "$GIT_DIR"/hooks/post-rewrite rebase <"$state_dir"/rewritten
- fi
+ hook="$(git rev-parse --git-path hooks/post-rewrite)"
+ test -x "$hook" && "$hook" rebase <"$state_dir"/rewritten
fi
say All done.
}