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 authored and Richard Gomez committed Apr 9, 2024
1 parent ccd1910 commit 7cb8af2
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 @@ -417,7 +417,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 7cb8af2

Please sign in to comment.