ObjectStat returns a os.FileInfo pointing the object file, if exists
(h plumbing.Hash)
| 624 | |
| 625 | // ObjectStat returns a os.FileInfo pointing the object file, if exists |
| 626 | func (d *DotGit) ObjectStat(h plumbing.Hash) (os.FileInfo, error) { |
| 627 | err := d.hasObject(h) |
| 628 | if err != nil { |
| 629 | return nil, err |
| 630 | } |
| 631 | |
| 632 | obj1, err1 := d.fs.Stat(d.objectPath(h)) |
| 633 | if os.IsNotExist(err1) && d.hasIncomingObjects() { |
| 634 | obj2, err2 := d.fs.Stat(d.incomingObjectPath(h)) |
| 635 | if err2 != nil { |
| 636 | return obj1, err1 |
| 637 | } |
| 638 | return obj2, err2 |
| 639 | } |
| 640 | return obj1, err1 |
| 641 | } |
| 642 | |
| 643 | // ObjectDelete removes the object file, if exists |
| 644 | func (d *DotGit) ObjectDelete(h plumbing.Hash) error { |