From c487643d7646aedb7c42de5f8993d8baef87bf29 Mon Sep 17 00:00:00 2001 From: Andrej730 Date: Sat, 14 Sep 2024 11:33:09 +0500 Subject: [PATCH] ifcgit - fix errors if paths are mixing up slashes and backslashes `repo.path` is always setup using current platform type of slashes since it's normalized by get_path_dir but when we pass a path to index.add it's not normalized leading to errors --- src/bonsai/bonsai/tool/ifcgit.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/bonsai/bonsai/tool/ifcgit.py b/src/bonsai/bonsai/tool/ifcgit.py index 222239598d..6016de6ff3 100644 --- a/src/bonsai/bonsai/tool/ifcgit.py +++ b/src/bonsai/bonsai/tool/ifcgit.py @@ -100,7 +100,7 @@ class IfcGit: def add_file_to_repo(cls, repo: git.Repo, path_file: str) -> None: if os.name == "nt": cls.dos2unix(path_file) - repo.index.add(path_file) + repo.index.add(os.path.normpath(path_file)) repo.index.commit(message="Added " + os.path.relpath(path_file, repo.working_dir)) bpy.ops.ifcgit.refresh() @@ -124,7 +124,7 @@ class IfcGit: repo = IfcGitRepo.repo if os.name == "nt": cls.dos2unix(path_file) - repo.index.add(path_file) + repo.index.add(os.path.normpath(path_file)) repo.index.commit(message=props.commit_message) props.commit_message = "" @@ -511,7 +511,7 @@ class IfcGit: else: if os.name == "nt": cls.dos2unix(path_ifc) - repo.index.add(path_ifc) + repo.index.add(os.path.normpath(path_ifc)) repo.git.commit("--no-edit") except git.exc.GitError: operator.report({"ERROR"}, "Unknown IFC Merge failure")