From e8f4be416c2a3b7e13cf2982b2dd986c5d77496b Mon Sep 17 00:00:00 2001 From: Alexander Dokuchaev Date: Sat, 2 Mar 2024 04:12:06 +0200 Subject: [PATCH] Path is not within git repository --- md_dead_link_check/link_checker.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/md_dead_link_check/link_checker.py b/md_dead_link_check/link_checker.py index 6643de5..d280dd8 100644 --- a/md_dead_link_check/link_checker.py +++ b/md_dead_link_check/link_checker.py @@ -128,7 +128,11 @@ def check_path_links(md_data: Dict[str, MarkdownInfo], root_dir: Path, config: C abs_path = (md_abs_path.parent / split_result.path).resolve() res_path = abs_path.relative_to(root_dir) except ValueError: - ret.append(StatusInfo(md_link, "Incorrect path")) + ret.append(StatusInfo(md_link, "Path is not within git repository")) + continue + + if abs_path.as_posix() != abs_path.resolve().as_posix(): + ret.append(StatusInfo(md_link, "Path is not within git repository")) continue if res_path.as_posix() not in md_data: