lib/git-hooks-debug.js
function runHooks(hooks, args, callback) {
    console.log('*** git-hooks.js runHooks', hooks, args);
    if (!hooks.length) {
        callback(0);
        return;
    }
    try {
        var hook = spawnHook(hooks.shift(), args);
        hook.on('close', function (code) {
            if (code === 0) {
                runHooks(hooks, args, callback);
            } else {
                callback(code);
            }
        });
    } catch (e) {
        callback(1, e);
    }
}
function runHooks(hooks, args, callback) {
    console.log('*** git-hooks.js runHooks', hooks, args);
    if (!hooks.length) {
        callback(0);
        return;
    }
    try {
        var hook = spawnHook(hooks.shift(), args);
        hook.on('close', function (code) {
            if (code === 0) {
                runHooks(hooks, args, callback);
            } else {
                callback(code);
            }
        });
    } catch (e) {
        callback(1, e);
    }
}
function runHooks ( hooks , args , callback ) { console . log ( '*** git-hooks.js runHooks' , hooks , args ) ; if ( ! hooks . length ) { callback ( 0 ) ; return ; } try { var hook = spawnHook ( hooks . shift ( ) , args ) ; hook . on ( 'close' , function ( code ) { if ( code === 0 ) { runHooks ( hooks , args , callback ) ; } else { callback ( code ) ; } } ) ; } catch ( e ) { callback ( 1 , e ) ; } }
Runs hooks.

@param {String[]} hooks List of hook names to execute.
@param {String[]} args
@param {Function} callback
Runs hooks .