diff options
Diffstat (limited to 'worktree_status.go')
-rw-r--r-- | worktree_status.go | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/worktree_status.go b/worktree_status.go index 828f6e0..ac4be3a 100644 --- a/worktree_status.go +++ b/worktree_status.go @@ -252,6 +252,9 @@ func (w *Worktree) Add(path string) (plumbing.Hash, error) { h, err := w.copyFileToStorage(path) if err != nil { + if os.IsNotExist(err) { + h, err = w.deleteFromIndex(path) + } return h, err } |