aboutsummaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorAleksandr Nogikh <nogikh@google.com>2023-11-27 13:01:08 +0100
committerAleksandr Nogikh <nogikh@google.com>2023-12-20 15:43:38 +0000
commit5b3b684f02a7433af213809184ca61b379e110f4 (patch)
tree4f6d6452c8ddcf73c8e199ee5aa2914fd7801729 /pkg
parent66b54764d3273df352f5807049ef8afa1674d402 (diff)
pkg/vcs: delete ListRecentCommits()
It's not needed anymore.
Diffstat (limited to 'pkg')
-rw-r--r--pkg/vcs/fuchsia.go4
-rw-r--r--pkg/vcs/git.go11
-rw-r--r--pkg/vcs/git_repo_test.go10
-rw-r--r--pkg/vcs/vcs.go3
4 files changed, 0 insertions, 28 deletions
diff --git a/pkg/vcs/fuchsia.go b/pkg/vcs/fuchsia.go
index bf1bedd9f..223c0b860 100644
--- a/pkg/vcs/fuchsia.go
+++ b/pkg/vcs/fuchsia.go
@@ -80,10 +80,6 @@ func (ctx *fuchsia) GetCommitsByTitles(titles []string) ([]*Commit, []string, er
return ctx.repo.GetCommitsByTitles(titles)
}
-func (ctx *fuchsia) ListRecentCommits(baseCommit string) ([]string, error) {
- return ctx.repo.ListRecentCommits(baseCommit)
-}
-
func (ctx *fuchsia) ExtractFixTagsFromCommits(baseCommit, email string) ([]*Commit, error) {
return ctx.repo.ExtractFixTagsFromCommits(baseCommit, email)
}
diff --git a/pkg/vcs/git.go b/pkg/vcs/git.go
index b3e9a7ace..71fcac97a 100644
--- a/pkg/vcs/git.go
+++ b/pkg/vcs/git.go
@@ -366,17 +366,6 @@ func (git *git) GetCommitsByTitles(titles []string) ([]*Commit, []string, error)
return results, missing, nil
}
-func (git *git) ListRecentCommits(baseCommit string) ([]string, error) {
- // On upstream kernel this produces ~11MB of output.
- // Somewhat inefficient to collect whole output in a slice
- // and then convert to string, but should be bearable.
- output, err := git.git("log", "--pretty=format:%s", "-n", "200000", baseCommit)
- if err != nil {
- return nil, err
- }
- return strings.Split(string(output), "\n"), nil
-}
-
func (git *git) ListCommitHashes(baseCommit string) ([]string, error) {
output, err := git.git("log", "--pretty=format:%h", baseCommit)
if err != nil {
diff --git a/pkg/vcs/git_repo_test.go b/pkg/vcs/git_repo_test.go
index adf222629..315cea5df 100644
--- a/pkg/vcs/git_repo_test.go
+++ b/pkg/vcs/git_repo_test.go
@@ -54,16 +54,6 @@ func TestGitRepo(t *testing.T) {
}
}
{
- commits, err := repo.ListRecentCommits(repo1.Commits["branch1"]["1"].Hash)
- if err != nil {
- t.Fatal(err)
- }
- want := []string{"repo1-branch1-1", "repo1-branch1-0", "repo1-master-0"}
- if diff := cmp.Diff(commits, want); diff != "" {
- t.Fatal(diff)
- }
- }
- {
want := repo2.Commits["branch1"]["0"]
com, err := repo.CheckoutCommit(repo2.Dir, want.Hash)
if err != nil {
diff --git a/pkg/vcs/vcs.go b/pkg/vcs/vcs.go
index ec17d642b..a83f66835 100644
--- a/pkg/vcs/vcs.go
+++ b/pkg/vcs/vcs.go
@@ -48,9 +48,6 @@ type Repo interface {
// Returns list of commits and titles of commits that are not found.
GetCommitsByTitles(titles []string) ([]*Commit, []string, error)
- // ListRecentCommits returns list of recent commit titles starting from baseCommit.
- ListRecentCommits(baseCommit string) ([]string, error)
-
// ExtractFixTagsFromCommits extracts fixing tags for bugs from git log.
// Given email = "user@domain.com", it searches for tags of the form "user+tag@domain.com"
// and returns commits with these tags.