Skip to content

Commit

Permalink
Fix the order to correctly match the params in NewGit. (#676)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav committed Jul 28, 2022
1 parent 0752503 commit 21e1ff4
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions pkg/sources/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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
}
Expand Down

0 comments on commit 21e1ff4

Please sign in to comment.