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 Jan 27, 2024
1 parent 76fcdae commit 438418c
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 @@ -374,7 +374,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 438418c

Please sign in to comment.