Merge branch 'ss/fix-config-fd-leak' into maint
[gitweb.git] / git-rebase--merge.sh
index d3fb67d75bd3cdfebd048594cdb67eb179b1c435..2cc2a6d2734c0ef12222004f22d717f4f724d82f 100644 (file)
@@ -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.
 }