Skip to content

Commit

Permalink
feat: double clone against AzDo to reduce libgit2 memory footprint (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
klesh authored Aug 22, 2024
1 parent 7d10ada commit 9390452
Show file tree
Hide file tree
Showing 4 changed files with 222 additions and 152 deletions.
2 changes: 2 additions & 0 deletions backend/plugins/gitextractor/gitextractor.go
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ func main() {
useGoGit := cmd.Flags().BoolP("useGoGit", "g", false, "use go-git instead of libgit2")
skipCommitStat := cmd.Flags().BoolP("skipCommitStat", "S", false, "")
skipCommitFiles := cmd.Flags().BoolP("skipCommitFiles", "F", true, "")
noShallowClone := cmd.Flags().BoolP("noShallowClone", "A", false, "")
timeAfter := cmd.Flags().StringP("timeAfter", "a", "", "collect data that are created after specified time, ie 2006-01-02T15:04:05Z")
_ = cmd.MarkFlagRequired("url")
_ = cmd.MarkFlagRequired("repoId")
Expand All @@ -54,6 +55,7 @@ func main() {
"useGoGit": *useGoGit,
"skipCommitStat": skipCommitStat,
"skipCommitFiles": skipCommitFiles,
"noShallowClone": noShallowClone,
}, *timeAfter)
}
runner.RunCmd(cmd)
Expand Down
4 changes: 2 additions & 2 deletions backend/plugins/gitextractor/parser/clone.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,9 +19,9 @@ package parser

import (
"github.com/apache/incubator-devlake/core/errors"
"github.com/apache/incubator-devlake/core/plugin"
)

type RepoCloner interface {
CloneRepo(ctx plugin.SubTaskContext, localDir string) errors.Error
CloneRepo() errors.Error
CloseRepo() errors.Error
}
Loading

0 comments on commit 9390452

Please sign in to comment.