mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-11-30 21:24:21 +01:00
fixing commit latest bug (#365)
This commit is contained in:
1 parent
212232f80a
commit
4801818e3d
4 files changed
+35
-12
No files matched your search
+9
-2
@@ -258,9 +258,16 @@ type commitInspector func(c *object.Commit, repo *Repo) error
|
||||
// inspectCommit accepts a commit hash, repo, and commit inspecting function. A new commit
|
||||
// object will be created from the hash which will be passed into either inspectCommitPatches
|
||||
// or inspectFilesAtCommit depending on the options set.
|
||||
func inspectCommit(hash string, repo *Repo, f commitInspector) error {
|
||||
func inspectCommit(commit string, repo *Repo, f commitInspector) error {
|
||||
if commit == "latest" {
|
||||
ref, err := repo.Repository.Head()
|
||||
if err != nil {
|
||||
return err
|
||||
}
|
||||
commit = ref.Hash().String()
|
||||
}
|
||||
repo.Manager.IncrementCommits(1)
|
||||
h := plumbing.NewHash(hash)
|
||||
h := plumbing.NewHash(commit)
|
||||
c, err := repo.CommitObject(h)
|
||||
if err != nil {
|
||||
return err
|
||||
|
||||
Reference in new issue
Block a user