mirror of
https://github.com/pre-commit/pre-commit.git
synced 2026-02-17 08:14:42 +04:00
adjust relative --commit-msg-filename if in subdir
This commit is contained in:
parent
78a2d867fe
commit
db51d3009f
2 changed files with 40 additions and 21 deletions
|
|
@ -155,6 +155,10 @@ def _adjust_args_and_chdir(args: argparse.Namespace) -> None:
|
|||
args.config = os.path.abspath(args.config)
|
||||
if args.command in {'run', 'try-repo'}:
|
||||
args.files = [os.path.abspath(filename) for filename in args.files]
|
||||
if args.commit_msg_filename is not None:
|
||||
args.commit_msg_filename = os.path.abspath(
|
||||
args.commit_msg_filename,
|
||||
)
|
||||
if args.command == 'try-repo' and os.path.exists(args.repo):
|
||||
args.repo = os.path.abspath(args.repo)
|
||||
|
||||
|
|
@ -164,6 +168,10 @@ def _adjust_args_and_chdir(args: argparse.Namespace) -> None:
|
|||
args.config = os.path.relpath(args.config)
|
||||
if args.command in {'run', 'try-repo'}:
|
||||
args.files = [os.path.relpath(filename) for filename in args.files]
|
||||
if args.commit_msg_filename is not None:
|
||||
args.commit_msg_filename = os.path.relpath(
|
||||
args.commit_msg_filename,
|
||||
)
|
||||
if args.command == 'try-repo' and os.path.exists(args.repo):
|
||||
args.repo = os.path.relpath(args.repo)
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue