Skip to content

Commit

Permalink
Fix for hooks management
Browse files Browse the repository at this point in the history
  • Loading branch information
eduard93 committed Mar 29, 2018
1 parent b5faf92 commit a6a0fd7
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions isc/git/hook/Manager.cls
Original file line number Diff line number Diff line change
Expand Up @@ -23,13 +23,11 @@ ClassMethod execute(directory As %String = "", ByRef hooks As %String = "", meth
do:directory'="" ..load(directory, .loadedHooks)
merge hooks = loadedHooks

do ..log("Executing hooks, method: " _ method)

/// Execute global hooks
do ..execute(hooks, method, "isc.git.hook.Global")
do ..executeInternal(.hooks, method, "isc.git.hook.Global")

/// Execute local hooks
do ..execute(hooks, method, "isc.git.hook.Local")
do ..executeInternal(.hooks, method, "isc.git.hook.Local")
} catch ex {
set sc = ex.AsStatus()
}
Expand All @@ -49,8 +47,10 @@ ClassMethod executeInternal(ByRef hooks As %String = "", method As %String(VALUE
continue:class=type
continue:((type="isc.git.hook.Local") && (..isDone(class)))

$$$TOE(sc, $classmethod(class, type))
do:((type="isc.git.hook.Local") && (type="after")) ..add(class)
do ..log("Executing hook class: " _ class)

$$$TOE(sc, $classmethod(class, method))
do:((type="isc.git.hook.Local") && (method="after")) ..add(class)
}
}

Expand All @@ -59,7 +59,7 @@ ClassMethod load(directory As %String, Output hooks As %String)
{
do ..log("Importing hooks dir " _ directory)
set hooks = ""
do $system.OBJ.ImportDir(directory, ##class(isc.git.GitLab).getExtWildcard(), "cukb", .errors, 1, .hooks)
do $system.OBJ.ImportDir(directory, ##class(isc.git.GitLab).getExtWildcard(), "cukb /displaylog=0", .errors, 1, .hooks)
throw:$get(errors,0)'=0 ##class(%Exception.General).%New("Hooks load error")
}

Expand Down

0 comments on commit a6a0fd7

Please sign in to comment.