From 93a0f7c9d89616f827c02a89e6d37a48aacb6549 Mon Sep 17 00:00:00 2001 From: Xavier Morel Date: Fri, 14 Mar 2025 12:14:47 +0100 Subject: [PATCH] [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 --- runbot_merge/git.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/runbot_merge/git.py b/runbot_merge/git.py index d2f9e92e..d1ce4be3 100644 --- a/runbot_merge/git.py +++ b/runbot_merge/git.py @@ -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: