summaryrefslogtreecommitdiffstats
path: root/pre_commit/main.py
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:22:18 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2023-01-04 07:22:18 +0000
commit58a809aa43ae21566be4613eb42ac56faf54f901 (patch)
tree371b9cc8a265cbabea4b12e5508b8bde6edf0b89 /pre_commit/main.py
parentAdding upstream version 2.20.0. (diff)
downloadpre-commit-d9e26b880842e09640eee6156a2dbfdacff3bfb3.tar.xz
pre-commit-d9e26b880842e09640eee6156a2dbfdacff3bfb3.zip
Adding upstream version 2.21.0.upstream/2.21.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'pre_commit/main.py')
-rw-r--r--pre_commit/main.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/pre_commit/main.py b/pre_commit/main.py
index b4fa966..3915993 100644
--- a/pre_commit/main.py
+++ b/pre_commit/main.py
@@ -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)