improve git project detection test coverage

This commit is contained in:
Alan Hamlett 2018-04-26 08:31:08 -07:00
parent 9afda875cb
commit c103020e9b
2 changed files with 64 additions and 8 deletions

View file

@ -79,8 +79,6 @@ class Git(BaseProject):
return True
disabled = self._configs.get('submodules_disabled')
if not disabled:
return True
if disabled.strip().lower() == 'true':
return False
@ -139,12 +137,13 @@ class Git(BaseProject):
with open(filepath, 'r', encoding='utf-8') as fh:
return fh.readline().strip()
except UnicodeDecodeError:
try:
with open(filepath, 'r', encoding=sys.getfilesystemencoding()) as fh:
return fh.readline().strip()
except:
log.traceback(logging.WARNING)
pass
except IOError:
pass
try:
with open(filepath, 'r', encoding=sys.getfilesystemencoding()) as fh:
return fh.readline().strip()
except:
log.traceback(logging.WARNING)
return None