'Retrieve the config object.
:return: `ConfigFile` object for the ``.git/config`` file.'

def get_config(self):

    from dulwich.config import ConfigFile
    path = os.path.join(self._controldir, 'config')
    try:
        return ConfigFile.from_path(path)
    except (IOError, OSError) as e:
        if (e.errno != errno.ENOENT):
            raise
        ret = ConfigFile()
        ret.path = path
        return ret
