diff options
| author | Aleksandr Nogikh <nogikh@google.com> | 2025-08-07 13:50:51 +0200 |
|---|---|---|
| committer | Aleksandr Nogikh <nogikh@google.com> | 2025-08-08 10:25:41 +0000 |
| commit | 265b79936233a0431f3f1032aa207af7f4a6f3c8 (patch) | |
| tree | c9bd46e7627f302be44539acc660c42fe865d4cc /syz-cluster/pkg | |
| parent | 53950748be0bac4ec27d0f34662c538824609845 (diff) | |
syz-cluster: support branch checkout in build-step
During smoke builds, we may have a tree name/branch name pair instead of
just a commit hash, which is the case for normal kernel build requests.
Support both types of requests.
Diffstat (limited to 'syz-cluster/pkg')
| -rw-r--r-- | syz-cluster/pkg/triage/git.go | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/syz-cluster/pkg/triage/git.go b/syz-cluster/pkg/triage/git.go index db8f6b629..7eab776c9 100644 --- a/syz-cluster/pkg/triage/git.go +++ b/syz-cluster/pkg/triage/git.go @@ -30,7 +30,15 @@ func NewGitTreeOps(dir string, sandbox bool) (*GitTreeOps, error) { func (ops *GitTreeOps) HeadCommit(tree *api.Tree) (*vcs.Commit, error) { // See kernel-disk/cron.yaml. - return ops.Commit(tree.Name + "-head") + return ops.Git.Commit(tree.Name + "-head") +} + +func (ops *GitTreeOps) Commit(treeName, commitOrBranch string) (*vcs.Commit, error) { + // See kernel-disk/cron.yaml. + if vcs.CheckCommitHash(commitOrBranch) { + return ops.Git.Commit(commitOrBranch) + } + return ops.Git.Commit(treeName + "/" + commitOrBranch) } func (ops *GitTreeOps) ApplySeries(commit string, patches [][]byte) error { |
