'parses the lines from git config --list into a dictionary'

def config_dict(self, local=True):

    kwargs = {u'list': True, u'global': (not local)}
    config_lines = self.git.config(**kwargs)[STDOUT].splitlines()
    newdict = {}
    for line in config_lines:
        try:
            (k, v) = line.split(u'=', 1)
        except:
            continue
        k = k.replace(u'.', u'_')
        if ((v == u'true') or (v == u'false')):
            v = bool(eval(v.title()))
        try:
            v = int(eval(v))
        except:
            pass
        newdict[k] = v
    return newdict
