(e *index.Entry, filename string, h plumbing.Hash)
| 531 | } |
| 532 | |
| 533 | func (w *Worktree) doUpdateFileToIndex(e *index.Entry, filename string, h plumbing.Hash) error { |
| 534 | info, err := w.Filesystem.Lstat(filename) |
| 535 | if err != nil { |
| 536 | return err |
| 537 | } |
| 538 | |
| 539 | e.Hash = h |
| 540 | e.ModifiedAt = info.ModTime() |
| 541 | e.Mode, err = filemode.NewFromOSFileMode(info.Mode()) |
| 542 | if err != nil { |
| 543 | return err |
| 544 | } |
| 545 | |
| 546 | if e.Mode.IsRegular() { |
| 547 | e.Size = uint32(info.Size()) |
| 548 | } |
| 549 | |
| 550 | fillSystemInfo(e, info.Sys()) |
| 551 | return nil |
| 552 | } |
| 553 | |
| 554 | // Remove removes files from the working tree and from the index. |
| 555 | func (w *Worktree) Remove(path string) (plumbing.Hash, error) { |
no test coverage detected