Fix pycharm plugin support large git diff over OS environment

This commit is contained in:
allegroai 2019-07-13 23:56:27 +03:00
parent 9c7e0747fb
commit e655dd6cdf

View File

@ -241,14 +241,19 @@ class EnvDetector(Detector):
if not repository_url:
raise DetectionError("No VCS environment data")
status = VCS_STATUS.get() or ''
diff = VCS_DIFF.get() or ''
modified = bool(diff or (status and [s for s in status.split('\n') if s.strip().startswith('M ')]))
if modified and not diff:
diff = '# Repository modified, but no git diff could be extracted.'
return Result(
url=repository_url,
branch=VCS_BRANCH.get(),
commit=VCS_COMMIT_ID.get(),
root=VCS_ROOT.get(converter=self._normalize_root),
status=VCS_STATUS.get(),
diff=VCS_DIFF.get(),
status=status,
diff=diff,
modified=modified,
)