ForEachObjectHash iterates over the hashes of objects found under the .git/objects/ directory and executes the provided function.
(fun func(plumbing.Hash) error)
| 426 | // ForEachObjectHash iterates over the hashes of objects found under the |
| 427 | // .git/objects/ directory and executes the provided function. |
| 428 | func (d *DotGit) ForEachObjectHash(fun func(plumbing.Hash) error) error { |
| 429 | if !d.options.ExclusiveAccess { |
| 430 | return d.forEachObjectHash(fun) |
| 431 | } |
| 432 | |
| 433 | err := d.genObjectList() |
| 434 | if err != nil { |
| 435 | return err |
| 436 | } |
| 437 | |
| 438 | for _, h := range d.objectList { |
| 439 | err := fun(h) |
| 440 | if err != nil { |
| 441 | return err |
| 442 | } |
| 443 | } |
| 444 | |
| 445 | return nil |
| 446 | } |
| 447 | |
| 448 | func (d *DotGit) forEachObjectHash(fun func(plumbing.Hash) error) error { |
| 449 | files, err := d.fs.ReadDir(objectsPath) |
no test coverage detected