Improve check for uncommitted files

Fixes #57
This commit is contained in:
Manuel Barkhau 2019-03-24 18:46:39 +01:00
parent 385521b596
commit 548fb871e0
4 changed files with 68 additions and 13 deletions

View file

@ -190,11 +190,11 @@ def init(verbose: int = 0, dry: bool = False) -> None:
config.write_content(ctx)
def _assert_not_dirty(vcs, filepaths: typ.Set[str], allow_dirty: bool):
dirty_files = vcs.status()
def _assert_not_dirty(_vcs: vcs.VCS, filepaths: typ.Set[str], allow_dirty: bool):
dirty_files = _vcs.status(required_files=filepaths)
if dirty_files:
log.warning(f"{vcs.name} working directory is not clean:")
log.warning(f"{_vcs.name} working directory is not clean. Uncomitted file(s):")
for dirty_file in dirty_files:
log.warning(" " + dirty_file)