(hash plumbing.Hash, t time.Time)
| 326 | } |
| 327 | |
| 328 | func (d *DotGit) DeleteOldObjectPackAndIndex(hash plumbing.Hash, t time.Time) error { |
| 329 | d.cleanPackList() |
| 330 | |
| 331 | path := d.objectPackPath(hash, `pack`) |
| 332 | if !t.IsZero() { |
| 333 | fi, err := d.fs.Stat(path) |
| 334 | if err != nil { |
| 335 | return err |
| 336 | } |
| 337 | // too new, skip deletion. |
| 338 | if !fi.ModTime().Before(t) { |
| 339 | return nil |
| 340 | } |
| 341 | } |
| 342 | err := d.fs.Remove(path) |
| 343 | if err != nil { |
| 344 | return err |
| 345 | } |
| 346 | return d.fs.Remove(d.objectPackPath(hash, `idx`)) |
| 347 | } |
| 348 | |
| 349 | // NewObject return a writer for a new object file. |
| 350 | func (d *DotGit) NewObject() (*ObjectWriter, error) { |
nothing calls this directly
no test coverage detected