diff options
| -rw-r--r-- | autogen.go | 9 |
1 files changed, 7 insertions, 2 deletions
@@ -13,9 +13,14 @@ import ( // del : true means empty out existing notes, otherwise append func (repo *Repo) AutogenSave(files []string, refname string, del bool) error { if del { - cmd := []string{"git", "notes", "remove", refname} + cmd := []string{"git", "notes", "show", refname} if err := repo.StrictRun(cmd); err != nil { - return err + // if there are not any notes, no need to remove them + } else { + cmd := []string{"git", "notes", "remove", refname} + if err := repo.StrictRun(cmd); err != nil { + return err + } } } for _, fname := range files { |
