Write content to model.ifc, stage and commit it. Returns commit hexsha.
(repo: "git.Repo", tmpdir: str, content: str, message: str)
| 47 | |
| 48 | |
| 49 | def _commit_ifc(repo: "git.Repo", tmpdir: str, content: str, message: str) -> str: |
| 50 | """Write content to model.ifc, stage and commit it. Returns commit hexsha.""" |
| 51 | ifc_path = os.path.join(tmpdir, "model.ifc") |
| 52 | with open(ifc_path, "w") as f: |
| 53 | f.write(content) |
| 54 | repo.index.add([os.path.normpath(ifc_path)]) |
| 55 | commit = repo.index.commit(message) |
| 56 | return commit.hexsha |
| 57 | |
| 58 | |
| 59 | # --------------------------------------------------------------------------- |
no test coverage detected