diff options
author | grunenwflorian <florian.grunenwald1@gmail.com> | 2017-09-05 11:28:36 +0200 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-09-05 11:28:36 +0200 |
commit | a33a60d244f94a07adeb70cfe938c97651c0ddc9 (patch) | |
tree | d8d1f4f009951bc84162c646d9a86084e01eb5ed /worktree_status.go | |
parent | f9879dd043f84936a1f8acb8a53b74332a7ae135 (diff) | |
download | go-git-a33a60d244f94a07adeb70cfe938c97651c0ddc9.tar.gz |
Worktree.Add: Support Add deleted files, fixes #571 (#577)
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 24d0534..b2848f9 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 } |