aboutsummaryrefslogtreecommitdiffstats
path: root/pkg/bisect
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2024-10-14 18:09:10 +0200
committerDmitry Vyukov <dvyukov@google.com>2024-10-15 09:08:36 +0000
commit42d3a37026616a8cb3a9da11ab8e5565ca6b6074 (patch)
tree6be4d678b1a05ef78450a4e9133eba3590509589 /pkg/bisect
parent7eb57b4aa460c38365f8c5aa77d06c3b750daa4b (diff)
pkg/vcs: change HeadCommit to Commit
Currently we have HeadCommit function that returns info about the HEAD commit. Change it to a more flexible Commit function that can return info about any commit. This will be used in future changes.
Diffstat (limited to 'pkg/bisect')
-rw-r--r--pkg/bisect/bisect.go6
-rw-r--r--pkg/bisect/bisect_test.go2
2 files changed, 4 insertions, 4 deletions
diff --git a/pkg/bisect/bisect.go b/pkg/bisect/bisect.go
index a0dd29bb5..1abd65e6b 100644
--- a/pkg/bisect/bisect.go
+++ b/pkg/bisect/bisect.go
@@ -186,7 +186,7 @@ func runImpl(cfg *Config, repo vcs.Repo, inst instance.Env) (*Result, error) {
BuildCPUs: cfg.BuildCPUs,
},
}
- head, err := repo.HeadCommit()
+ head, err := repo.Commit(vcs.HEAD)
if err != nil {
return nil, err
}
@@ -602,7 +602,7 @@ type testResult struct {
}
func (env *env) build() (*vcs.Commit, string, error) {
- current, err := env.repo.HeadCommit()
+ current, err := env.repo.Commit(vcs.HEAD)
if err != nil {
return nil, "", err
}
@@ -782,7 +782,7 @@ func (env *env) revisionHadBug() (bool, error) {
// But let's first see how many extra test() runs we get without it.
// We'll likely change the revision below. Ensure we get back to the original one.
- curr, err := env.repo.HeadCommit()
+ curr, err := env.repo.Commit(vcs.HEAD)
if err != nil {
return false, err
}
diff --git a/pkg/bisect/bisect_test.go b/pkg/bisect/bisect_test.go
index 6731eb235..5160cffed 100644
--- a/pkg/bisect/bisect_test.go
+++ b/pkg/bisect/bisect_test.go
@@ -133,7 +133,7 @@ func (env *testEnv) Test(numVMs int, reproSyz, reproOpts, reproC []byte) ([]inst
}
func (env *testEnv) headCommit() int {
- com, err := env.r.HeadCommit()
+ com, err := env.r.Commit(vcs.HEAD)
if err != nil {
env.t.Fatal(err)
}