(c commitgraph.CommitNode, treePath string, paths []string)
| 130 | } |
| 131 | |
| 132 | func getFileHashes(c commitgraph.CommitNode, treePath string, paths []string) (map[string]plumbing.Hash, error) { |
| 133 | tree, err := getCommitTree(c, treePath) |
| 134 | if err == object.ErrDirectoryNotFound { |
| 135 | // The whole tree didn't exist, so return empty map |
| 136 | return make(map[string]plumbing.Hash), nil |
| 137 | } |
| 138 | if err != nil { |
| 139 | return nil, err |
| 140 | } |
| 141 | |
| 142 | hashes := make(map[string]plumbing.Hash) |
| 143 | for _, path := range paths { |
| 144 | if path != "" { |
| 145 | entry, err := tree.FindEntry(path) |
| 146 | if err == nil { |
| 147 | hashes[path] = entry.Hash |
| 148 | } |
| 149 | } else { |
| 150 | hashes[path] = tree.Hash |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | return hashes, nil |
| 155 | } |
| 156 | |
| 157 | func getLastCommitForPaths(c commitgraph.CommitNode, treePath string, paths []string) (map[string]*object.Commit, error) { |
| 158 | // We do a tree traversal with nodes sorted by commit time |
no test coverage detected
searching dependent graphs…