def git_config_get_value(section, option, default=None, as_bool=False):
    """Get config value for section/option."""
    cmd = ["git", "config", "--get", "%s.%s" % (section, option)]
    if as_bool:
        cmd.insert(2, "--bool")
    if LOCAL_MODE:
        __, git_dir = git_directories()
        cmd[2:2] = ['-f', os.path.join(git_dir, 'config')]
    try:
        return run_command_exc(GitConfigException, *cmd).strip()
    except GitConfigException as exc:
        if exc.rc == 1:
            return default
        raise
dataset/ETHPy150Open openstack-infra/git-restack/git_restack/cmd.py/git_config_get_value/original