diff options
Diffstat (limited to 'modules/git/repo_branch_gogit.go')
-rw-r--r-- | modules/git/repo_branch_gogit.go | 29 |
1 files changed, 0 insertions, 29 deletions
diff --git a/modules/git/repo_branch_gogit.go b/modules/git/repo_branch_gogit.go index 1c0d9a18aa..d1ec14d811 100644 --- a/modules/git/repo_branch_gogit.go +++ b/modules/git/repo_branch_gogit.go @@ -7,7 +7,6 @@ package git import ( - "context" "sort" "strings" @@ -96,34 +95,6 @@ func (repo *Repository) GetBranchNames(skip, limit int) ([]string, int, error) { } // WalkReferences walks all the references from the repository -// refType should be empty, ObjectTag or ObjectBranch. All other values are equivalent to empty. -func WalkReferences(ctx context.Context, repoPath string, walkfn func(sha1, refname string) error) (int, error) { - repo := RepositoryFromContext(ctx, repoPath) - if repo == nil { - var err error - repo, err = OpenRepository(ctx, repoPath) - if err != nil { - return 0, err - } - defer repo.Close() - } - - i := 0 - iter, err := repo.gogitRepo.References() - if err != nil { - return i, err - } - defer iter.Close() - - err = iter.ForEach(func(ref *plumbing.Reference) error { - err := walkfn(ref.Hash().String(), string(ref.Name())) - i++ - return err - }) - return i, err -} - -// WalkReferences walks all the references from the repository func (repo *Repository) WalkReferences(arg ObjectType, skip, limit int, walkfn func(sha1, refname string) error) (int, error) { i := 0 var iter storer.ReferenceIter |