Skip to content

Commit

Permalink
feat(git): clone hidden refs
Browse files Browse the repository at this point in the history
  • Loading branch information
rgmz committed Oct 30, 2023
1 parent 0427985 commit ec2de50
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion pkg/sources/git/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -358,7 +358,13 @@ func executeClone(ctx context.Context, params cloneParams) (*git.Repository, err
cloneURL.User = params.userInfo
}

gitArgs := []string{"clone", cloneURL.String(), params.clonePath}
gitArgs := []string{
"clone", cloneURL.String(), params.clonePath,
// Fetch additional refs from GitHub and GitLab.
// https://github.com/trufflesecurity/trufflehog/issues/1588
"-c", "remote.origin.fetch=+refs/pull/*:refs/heads/pull/*",
"-c", "remote.origin.fetch=+refs/merge-requests/*:refs/heads/merge-requests/*",
}
gitArgs = append(gitArgs, params.args...)
cloneCmd := exec.Command("git", gitArgs...)

Expand Down

0 comments on commit ec2de50

Please sign in to comment.