From 21e1ff4a8a2ca8fd7ea3f3a5c8adcc1e9fe3c599 Mon Sep 17 00:00:00 2001 From: ahrav Date: Thu, 28 Jul 2022 13:23:45 -0700 Subject: [PATCH] Fix the order to correctly match the params in NewGit. (#676) --- pkg/sources/git/git.go | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/pkg/sources/git/git.go b/pkg/sources/git/git.go index 78ef4008..9b53b778 100644 --- a/pkg/sources/git/git.go +++ b/pkg/sources/git/git.go @@ -107,7 +107,7 @@ func (s *Source) Init(aCtx context.Context, name string, jobId, sourceId int64, } s.git = NewGit(s.Type(), s.jobId, s.sourceId, s.name, s.verify, concurrency, - func(file, email, commit, repository, timestamp string, line int64) *source_metadatapb.MetaData { + func(file, email, commit, timestamp, repository string, line int64) *source_metadatapb.MetaData { return &source_metadatapb.MetaData{ Data: &source_metadatapb.MetaData_Git{ Git: &source_metadatapb.Git{ @@ -177,7 +177,7 @@ func (s *Source) Chunks(ctx context.Context, chunksChan chan *sources.Chunk) err continue } if !strings.HasSuffix(u, "git") { - //try paths instead of url + // try paths instead of url repo, err := RepoFromPath(u) if err != nil { return err @@ -431,9 +431,9 @@ func (s *Git) ScanRepo(_ context.Context, repo *git.Repository, repoPath string, return nil } -//GenerateLink crafts a link to the specific file from a commit. This works in most major git providers (Github/Gitlab) +// GenerateLink crafts a link to the specific file from a commit. This works in most major git providers (Github/Gitlab) func GenerateLink(repo, commit, file string) string { - //bitbucket links are commits not commit... + // bitbucket links are commits not commit... if strings.Contains(repo, "bitbucket.org/") { return repo[:len(repo)-4] + "/commits/" + commit }