mirror of
https://github.com/gitleaks/gitleaks.git
synced 2026-12-02 05:54:21 +01:00
supporting private repos... again, removing go-git and deps
This commit is contained in:
1 parent
744ff2f876
commit
b9657155b2
383 files changed
+2
-94490
No files matched your search
-26
@@ -1,26 +0,0 @@
|
||||
package object
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
|
||||
"gopkg.in/src-d/go-git.v4/utils/merkletrie"
|
||||
"gopkg.in/src-d/go-git.v4/utils/merkletrie/noder"
|
||||
)
|
||||
|
||||
// DiffTree compares the content and mode of the blobs found via two
|
||||
// tree objects.
|
||||
func DiffTree(a, b *Tree) (Changes, error) {
|
||||
from := NewTreeRootNode(a)
|
||||
to := NewTreeRootNode(b)
|
||||
|
||||
hashEqual := func(a, b noder.Hasher) bool {
|
||||
return bytes.Equal(a.Hash(), b.Hash())
|
||||
}
|
||||
|
||||
merkletrieChanges, err := merkletrie.DiffTree(from, to, hashEqual)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
|
||||
return newChanges(merkletrieChanges)
|
||||
}
|
||||
Reference in new issue
Block a user