diff options
| author | Jeff Carr <[email protected]> | 2024-12-13 17:31:40 -0600 |
|---|---|---|
| committer | Jeff Carr <[email protected]> | 2024-12-13 17:31:40 -0600 |
| commit | 1e4b0c0d3742bc953d5b21e3d901e94d1268c72f (patch) | |
| tree | 86c8de8a46ab26fa0052b178889208b72d983d6b | |
| parent | 2574ec733a812a747b3e4075f8affc862453034f (diff) | |
check for notes before deleting themv0.0.28
| -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 { |
