ForEachInOrder visits Included and Excluded in the original changeset order. providerExcluded is true for built-in directory exclusions. Files dropped by .gitignore are not visited.
(visit func(d model.Diff, providerExcluded bool))
| 81 | // providerExcluded is true for built-in directory exclusions. Files dropped by |
| 82 | // .gitignore are not visited. |
| 83 | func (s DiffSet) ForEachInOrder(visit func(d model.Diff, providerExcluded bool)) { |
| 84 | next := 0 |
| 85 | for i, d := range s.Excluded { |
| 86 | // excludedAt[i] is the mixed-stream index, so the number of included |
| 87 | // files that precede this exclusion is excludedAt[i]-i. |
| 88 | upTo := s.excludedAt[i] - i |
| 89 | for ; next < upTo; next++ { |
| 90 | visit(s.Included[next], false) |
| 91 | } |
| 92 | visit(d, true) |
| 93 | } |
| 94 | for ; next < len(s.Included); next++ { |
| 95 | visit(s.Included[next], false) |
| 96 | } |
| 97 | } |
| 98 | |
| 99 | // NewProvider creates a Provider for range mode: from..to (via merge-base). |
| 100 | func NewProvider(repoDir, from, to string, runner *gitcmd.Runner) *Provider { |