filter-repo: fix bug in checking for uncommitted but staged changes

Signed-off-by: Elijah Newren <newren@gmail.com>
This commit is contained in:
Elijah Newren 2019-03-13 17:38:03 -07:00
parent e913ccbe8d
commit 8ecd7a0d88

View File

@ -2749,7 +2749,7 @@ class RepoFilter(object):
# Do extra checks in non-bare repos
if not is_bare:
# Avoid uncommitted, unstaged, or untracked changes
if subprocess.call('git diff --staged'.split()):
if subprocess.call('git diff --staged --quiet'.split()):
abort("you have uncommitted changes")
if subprocess.call('git diff --quiet'.split()):
abort("you have unstaged changes")