From a17f25c06dcb8543d95fe98be5a9daf9ae079463 Mon Sep 17 00:00:00 2001 From: eduard93 Date: Thu, 29 Mar 2018 23:22:58 +0300 Subject: [PATCH] Correct hook execution order --- isc/git/hook/Manager.cls | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/isc/git/hook/Manager.cls b/isc/git/hook/Manager.cls index 4e85004..ae09837 100644 --- a/isc/git/hook/Manager.cls +++ b/isc/git/hook/Manager.cls @@ -23,11 +23,20 @@ ClassMethod execute(directory As %String = "", ByRef hooks As %String = "", meth do:directory'="" ..load(directory, .loadedHooks) merge hooks = loadedHooks - /// Execute global hooks - do ..executeInternal(.hooks, method, "isc.git.hook.Global") + if (method="before") { - /// Execute local hooks - do ..executeInternal(.hooks, method, "isc.git.hook.Local") + /// Execute global hooks + do ..executeInternal(.hooks, method, "isc.git.hook.Global") + + /// Execute local hooks + do ..executeInternal(.hooks, method, "isc.git.hook.Local") + } elseif (method="after") { + /// Execute local hooks + do ..executeInternal(.hooks, method, "isc.git.hook.Local") + + /// Execute global hooks + do ..executeInternal(.hooks, method, "isc.git.hook.Global") + } } catch ex { set sc = ex.AsStatus() }