Skip to content

Commit 39b98e6

Browse files
committed
syz-cluster: don't use custom git tree tags
Since remote branches are already mapped to "tree/name" local branches, there's no need for the special "tree-HEAD" tag anymore. Simplify the code.
1 parent 97f86ea commit 39b98e6

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

syz-cluster/kernel-disk/fetch-kernels-template.yaml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,4 +72,3 @@ spec:
7272
git remote add ${NAME} ${REPO}
7373
git fetch ${NAME} ${BRANCH} --tags "+refs/heads/*:refs/heads/${NAME}/*" "+refs/tags/*:refs/tags/${NAME}/*"
7474
git log -1 --format="%h %an %ad %s" ${NAME}/${BRANCH}
75-
git tag -f ${NAME}-head ${NAME}/${BRANCH}

syz-cluster/pkg/triage/git.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ func NewGitTreeOps(dir string, sandbox bool) (*GitTreeOps, error) {
3030

3131
func (ops *GitTreeOps) HeadCommit(tree *api.Tree) (*vcs.Commit, error) {
3232
// See kernel-disk/cron.yaml.
33-
return ops.Git.Commit(tree.Name + "-head")
33+
return ops.Git.Commit(tree.Name + "/" + tree.Branch)
3434
}
3535

3636
func (ops *GitTreeOps) Commit(treeName, commitOrBranch string) (*vcs.Commit, error) {

syz-cluster/pkg/triage/git_test.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,18 +20,18 @@ func TestGitTreeOpsHead(t *testing.T) {
2020
osutil.WriteFile(filepath.Join(baseDir, "file.txt"), []byte("Some content"))
2121
repo.Git("add", "file.txt")
2222
head1 := repo.CommitChange("first head")
23-
repo.SetTag("mainline-head")
23+
repo.SetTag("mainline/main")
2424
osutil.WriteFile(filepath.Join(baseDir, "file.txt"), []byte("Another content"))
2525
repo.Git("add", "file.txt")
2626
head2 := repo.CommitChange("second head")
27-
repo.SetTag("second-head")
27+
repo.SetTag("second/main")
2828
// Verify that the right commits are queried.
2929
ops, err := NewGitTreeOps(baseDir, false)
3030
assert.NoError(t, err)
31-
commit, err := ops.HeadCommit(&api.Tree{Name: "mainline"})
31+
commit, err := ops.HeadCommit(&api.Tree{Name: "mainline", Branch: "main"})
3232
assert.NoError(t, err)
3333
assert.Equal(t, head1.Hash, commit.Hash)
34-
commit, err = ops.HeadCommit(&api.Tree{Name: "second"})
34+
commit, err = ops.HeadCommit(&api.Tree{Name: "second", Branch: "main"})
3535
assert.NoError(t, err)
3636
assert.Equal(t, head2.Hash, commit.Hash)
3737
}

0 commit comments

Comments
 (0)