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
This commit is contained in:
Andrej730
2024-09-14 11:33:09 +05:00
parent 6dbfb3afb3
commit c487643d76
+3 -3
View File
@@ -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")