improve git project detection test coverage
This commit is contained in:
parent
9afda875cb
commit
c103020e9b
2 changed files with 64 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue