e2e-tests: Return root commit SHA for worktree repo

This commit is contained in:
2021-12-31 10:54:07 +01:00
parent fcbad5a3eb
commit ef381c7421
6 changed files with 34 additions and 31 deletions

View File

@@ -174,7 +174,10 @@ class TempGitRepositoryWorktree:
git --git-dir .git-main-working-tree config core.bare true
"""
)
return self.tmpdir.name
commit = git.Repo(
f"{self.tmpdir.name}/.git-main-working-tree"
).head.commit.hexsha
return (self.tmpdir.name, commit)
def __exit__(self, exc_type, exc_val, exc_tb):
del self.tmpdir