Thread (14 messages) flat view 14 messages, 6 authors, 2018-07-10
STALE2961d

[PATCH] respect core.hooksPath, falling back to .git/hooks

From: Philipp Gortan <hidden>
Date: 2017-06-02 20:23:15
Subsystem: the rest · Maintainer: Linus Torvalds

Signed-off-by: Philipp Gortan <redacted>
---

The following patch tries to fix git-gui to respect the core.hooksPath config
variable, falling back to the old behavior.

git-gui.sh | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/git-gui.sh b/git-gui.sh
index 5bc21b8..a5335b1 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -624,7 +624,10 @@ proc git_write {args} {
 }
 
 proc githook_read {hook_name args} {
-	set pchook [gitdir hooks $hook_name]
+	if {[catch {set hooksdir [git config core.hooksPath]}]} {
+		set hooksdir [gitdir hooks]
+	}
+	set pchook [file join $hooksdir $hook_name]
 	lappend args 2>@1
 
 	# On Windows [file executable] might lie so we need to ask
-- 
2.13.0
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help