def run_commit_hook(name, index):
    hp = hook_path(name, index.repo.git_dir)
    if not os.access(hp, os.X_OK):
        return

    env = os.environ.copy()
    env['GIT_INDEX_FILE'] = index.path
    env['GIT_EDITOR'] = ':'
    cmd = subprocess.Popen(hp,
                           env=env,
                           stdout=subprocess.PIPE,
                           stderr=subprocess.PIPE,
                           cwd=index.repo.working_dir,
                           close_fds=(os.name == 'posix'))
    stdout, stderr = cmd.communicate()
    cmd.stdout.close()
    cmd.stderr.close()

    if cmd.returncode != 0:
        stdout = force_text(stdout, defenc)
        stderr = force_text(stderr, defenc)
        raise HookExecutionError(hp, cmd.returncode, stdout, stderr)
    # end handle return code
Get extensions to the request.
dataset/ETHPy150Open gitpython-developers/GitPython/git/index/fun.py/run_commit_hook--crossover with--dataset/ETHPy150Open cloudera/hue/desktop/core/ext-py/pyopenssl/OpenSSL/crypto.py/X509Req.get_extensions