Documentation ¶
Index ¶
- func BranchHeads(repo *gogit.Repository) (map[string]*object.Commit, error)
- func FindBranch(commit *object.Commit, repo *gogit.Repository) string
- func GenerateDiff(commit *object.Commit, fileName string) string
- func PrintPlainOutput(r *detectors.ResultWithMetadata)
- type LegacyJSONCompatibleSource
- type LegacyJSONOutput
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BranchHeads ¶
BranchHeads creates a map of branch names to their head commit. This can be used to find if a commit is an ancestor of a branch head.
func FindBranch ¶
func FindBranch(commit *object.Commit, repo *gogit.Repository) string
FindBranch returns the first branch a commit is a part of. Not the most accurate, but it should work similar to pre v3.0.
func GenerateDiff ¶
GenerateDiff will take a commit and create a string diff between the commit and its first parent.
func PrintPlainOutput ¶
func PrintPlainOutput(r *detectors.ResultWithMetadata)
Types ¶
type LegacyJSONOutput ¶
type LegacyJSONOutput struct { Branch string `json:"branch"` Commit string `json:"commit"` CommitHash string `json:"commitHash"` Date string `json:"date"` Diff string `json:"diff"` Path string `json:"path"` PrintDiff string `json:"printDiff"` Reason string `json:"reason"` StringsFound []string `json:"stringsFound"` }
func ConvertToLegacyJSON ¶
func ConvertToLegacyJSON(r *detectors.ResultWithMetadata, repoPath string) *LegacyJSONOutput
Click to show internal directories.
Click to hide internal directories.