[IMP] runbot_merge: get_tree impl

- ensure all its requirements are set
- rename parameter as `rev-parse` can take an arbitrary rev expression
  not just a commit
This commit is contained in:
Xavier Morel 2025-03-14 12:14:47 +01:00
parent 335a52580c
commit 93a0f7c9d8

View File

@ -147,10 +147,10 @@ class Repo:
)
return Repo(to)
def get_tree(self, commit_hash: str) -> str:
r = self.with_config(check=True).rev_parse(f'{commit_hash}^{{tree}}')
return r.stdout.strip()
def get_tree(self, rev: str) -> str:
return self.stdout().with_config(check=True, encoding="utf-8")\
.rev_parse(f'{rev}^{{tree}}')\
.stdout.strip()
def rebase(self, dest: str, commits: Sequence[PrCommit]) -> Tuple[str, Dict[str, str]]:
"""Implements rebase by hand atop plumbing so: