Adding upstream version 2.21.0.
Signed-off-by: Daniel Baumann <daniel@debian.org>
This commit is contained in:
parent
75fbdf4c0c
commit
cf86d7d6dd
48 changed files with 534 additions and 210 deletions
|
@ -263,7 +263,7 @@ def _all_filenames(args: argparse.Namespace) -> Collection[str]:
|
|||
|
||||
def _get_diff() -> bytes:
|
||||
_, out, _ = cmd_output_b(
|
||||
'git', 'diff', '--no-ext-diff', '--ignore-submodules', retcode=None,
|
||||
'git', 'diff', '--no-ext-diff', '--ignore-submodules', check=False,
|
||||
)
|
||||
return out
|
||||
|
||||
|
@ -318,7 +318,7 @@ def _has_unmerged_paths() -> bool:
|
|||
def _has_unstaged_config(config_file: str) -> bool:
|
||||
retcode, _, _ = cmd_output_b(
|
||||
'git', 'diff', '--no-ext-diff', '--exit-code', config_file,
|
||||
retcode=None,
|
||||
check=False,
|
||||
)
|
||||
# be explicit, other git errors don't mean it has an unstaged config.
|
||||
return retcode == 1
|
||||
|
@ -333,7 +333,7 @@ def run(
|
|||
stash = not args.all_files and not args.files
|
||||
|
||||
# Check if we have unresolved merge conflict files and fail fast.
|
||||
if _has_unmerged_paths():
|
||||
if stash and _has_unmerged_paths():
|
||||
logger.error('Unmerged files. Resolve before committing.')
|
||||
return 1
|
||||
if bool(args.from_ref) != bool(args.to_ref):
|
||||
|
@ -420,7 +420,11 @@ def run(
|
|||
return 1
|
||||
|
||||
skips = _get_skips(environ)
|
||||
to_install = [hook for hook in hooks if hook.id not in skips]
|
||||
to_install = [
|
||||
hook
|
||||
for hook in hooks
|
||||
if hook.id not in skips and hook.alias not in skips
|
||||
]
|
||||
install_hook_envs(to_install, store)
|
||||
|
||||
return _run_hooks(config, hooks, skips, args)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue