config: register git.authors

This commit is contained in:
Kevin Bullock 2017-10-24 14:26:35 -05:00
parent 44a24b6034
commit febc5953e1
2 changed files with 4 additions and 2 deletions

View File

@ -64,6 +64,7 @@ def read_pkt_refs(proto):
CONFIG_DEFAULTS = { CONFIG_DEFAULTS = {
'git': { 'git': {
'authors': None,
'blockdotgit': True, 'blockdotgit': True,
'branch_bookmark_suffix': None, 'branch_bookmark_suffix': None,
'intree': None, 'intree': None,

View File

@ -158,8 +158,9 @@ class GitHandler(object):
def init_author_file(self): def init_author_file(self):
self.author_map = {} self.author_map = {}
if self.ui.config('git', 'authors'): authors_path = compat.config(self.ui, 'string', 'git', 'authors')
with open(self.repo.wvfs.join(self.ui.config('git', 'authors'))) as f: if authors_path:
with open(self.repo.wvfs.join(authors_path)) as f:
for line in f: for line in f:
line = line.strip() line = line.strip()
if not line or line.startswith('#'): if not line or line.startswith('#'):