repos: Fix false positives when detecting dirty repos

This fixes a regression of 5b85fba0: diff-index is porcelain and seems
to lack some explicit refresh prior to being called. Therefore, it can
incorrectly detect files as being modified although a "git diff" will
not - and will actually also update the status so that the next
diff-index would be fine again.

Fix those false positives while still detecting also cached changes by
using git status -s instead.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka 2018-08-24 16:11:20 +02:00 committed by Daniel Wagner
parent 3744ff329a
commit 76e7339fdb

View File

@ -294,7 +294,7 @@ class GitRepo(RepoImpl):
return ['git', 'fetch', '--all']
def is_dirty_cmd(self):
return ['git', 'diff-index', 'HEAD', '--shortstat']
return ['git', 'status', '-s']
def current_rev_cmd(self):
return ['git', 'rev-parse', '--verify', 'HEAD']