def skip_commit(self, commit: DiffWithGitHubMetadata) -> None: """ Skip a diff, because we happen to know that there were no local changes. We have to update the internal metadata of the Submitter, so you're still obligated to call this even if you think there's nothing to do. """ ghnum = commit.ghnum username = commit.username self.stack_meta.append(DiffMeta( title=commit.title, number=commit.number, body=commit.body, ghnum=ghnum, username=username, push_branches=(), head_branch=None, what='Skipped', closed=commit.closed, pr_url=commit.pull_request_resolved.url(self.github_url), )) self.base_commit = GitCommitHash(self.sh.git( "rev-parse", self.remote_name + "/" + branch_head(username, ghnum))) self.base_orig = GitCommitHash(self.sh.git( "rev-parse", self.remote_name + "/" + branch_orig(username, ghnum) )) self.base_tree = GitTreeHash(self.sh.git( "rev-parse", self.base_orig + "^{tree}" ))
def tree(self) -> GitTreeHash: return GitTreeHash(self._search_group(RE_RAW_TREE, "tree"))