Skip to content

Commit

Permalink
fix(commit): correct the stage checker before commiting
Browse files Browse the repository at this point in the history
related to #418
  • Loading branch information
xaviml committed Sep 11, 2021
1 parent 79b3156 commit e92e07f
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions commitizen/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -155,9 +155,8 @@ def find_git_project_root() -> Optional[Path]:

def is_staging_clean() -> bool:
"""Check if staing is clean."""
c = cmd.run("git diff --no-ext-diff --name-only")
c_cached = cmd.run("git diff --no-ext-diff --cached --name-only")
return not (bool(c.out) or bool(c_cached.out))
c = cmd.run("git diff --no-ext-diff --cached --name-only")
return not bool(c.out)


def is_git_project() -> bool:
Expand Down

0 comments on commit e92e07f

Please sign in to comment.