MCPcopy Index your code
hub / github.com/go-git/go-git / hasFileChange

Method hasFileChange

plumbing/object/commit_walker_path.go:116–135  ·  view source on GitHub ↗
(changes Changes, parent *Commit)

Source from the content-addressed store, hash-verified

114}
115
116func (c *commitPathIter) hasFileChange(changes Changes, parent *Commit) bool {
117 for _, change := range changes {
118 if !c.pathFilter(change.name()) {
119 continue
120 }
121
122 // filename matches, now check if source iterator contains all commits (from all refs)
123 if c.checkParent {
124 // Check if parent is beyond the initial commit
125 if parent == nil || isParentHash(parent.Hash, c.currentCommit) {
126 return true
127 }
128 continue
129 }
130
131 return true
132 }
133
134 return false
135}
136
137func isParentHash(hash plumbing.Hash, commit *Commit) bool {
138 for _, h := range commit.ParentHashes {

Callers 1

getNextFileCommitMethod · 0.95

Calls 2

isParentHashFunction · 0.85
nameMethod · 0.80

Tested by

no test coverage detected