Skip to content

Commit

Permalink
'Refactored by Sourcery'
Browse files Browse the repository at this point in the history
  • Loading branch information
Sourcery AI authored and akaihola committed Jul 12, 2021
1 parent 88d8d40 commit 6f0a2de
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/darker/git.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ def _git_check_output_lines(
.splitlines()
)
except CalledProcessError as exc_info:
if exc_info.returncode == 128 and exit_on_error:
# Bad revision or another Git failure. Follow Black's example and return the
# error status 123.
for error_line in exc_info.stderr.decode("utf-8").splitlines():
logger.error(error_line)
sys.exit(123)
else:
if exc_info.returncode != 128 or not exit_on_error:
raise

# Bad revision or another Git failure. Follow Black's example and return the
# error status 123.
for error_line in exc_info.stderr.decode("utf-8").splitlines():
logger.error(error_line)
sys.exit(123)


def git_get_modified_files(
paths: Iterable[Path], revrange: RevisionRange, cwd: Path
Expand Down

0 comments on commit 6f0a2de

Please sign in to comment.