4
0

git.go 1.0 KB

1234567891011121314151617181920212223242526272829303132333435
  1. package detect
  2. import (
  3. "context"
  4. "github.com/zricethezav/gitleaks/v8/cmd/scm"
  5. "github.com/zricethezav/gitleaks/v8/report"
  6. "github.com/zricethezav/gitleaks/v8/sources"
  7. )
  8. // RemoteInfo is an alias for sources.RemoteInfo for backwards compatibility
  9. //
  10. // Deprecated: This will be replaced with sources.RemoteInfo in v9
  11. type RemoteInfo sources.RemoteInfo
  12. // DetectGit runs detections against a GitCmd with its remote info
  13. //
  14. // Deprecated: Use sources.Git and detector.DetectSource instead
  15. func (d *Detector) DetectGit(cmd *sources.GitCmd, remote *RemoteInfo) ([]report.Finding, error) {
  16. return d.DetectSource(
  17. context.Background(),
  18. &sources.Git{
  19. Cmd: cmd,
  20. Config: &d.Config,
  21. Remote: (*sources.RemoteInfo)(remote),
  22. Sema: d.Sema,
  23. MaxArchiveDepth: d.MaxArchiveDepth,
  24. },
  25. )
  26. }
  27. // Deprecated: use sources.NewRemoteInfo instead
  28. func NewRemoteInfo(platform scm.Platform, source string) *RemoteInfo {
  29. return (*RemoteInfo)(sources.NewRemoteInfo(platform, source))
  30. }