Skip to content

Commit

Permalink
remove unnecessary Git cmd check (trufflesecurity#2175)
Browse files Browse the repository at this point in the history
  • Loading branch information
ahrav authored Dec 6, 2023
1 parent cb81f7d commit e6bc7f4
Showing 1 changed file with 0 additions and 9 deletions.
9 changes: 0 additions & 9 deletions pkg/sources/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -338,11 +338,6 @@ type cloneParams struct {
// The core cloning logic is delegated to a nested function, which returns errors to the
// outer function for centralized error handling and cleanup.
func CloneRepo(ctx context.Context, userInfo *url.Userinfo, gitURL string, args ...string) (string, *git.Repository, error) {
var err error
if err = GitCmdCheck(); err != nil {
return "", nil, err
}

clonePath, err := cleantemp.MkdirTemp()
if err != nil {
return "", nil, err
Expand Down Expand Up @@ -460,10 +455,6 @@ func (s *Git) CommitsScanned() uint64 {
const gitDirName = ".git"

func (s *Git) ScanCommits(ctx context.Context, repo *git.Repository, path string, scanOptions *ScanOptions, reporter sources.ChunkReporter) error {
if err := GitCmdCheck(); err != nil {
return err
}

commitChan, err := gitparse.NewParser().RepoPath(ctx, path, scanOptions.HeadHash, scanOptions.BaseHash == "", scanOptions.ExcludeGlobs, scanOptions.Bare)
if err != nil {
return err
Expand Down

0 comments on commit e6bc7f4

Please sign in to comment.