diff options
author | Michael Muré <batolettre@gmail.com> | 2018-09-04 18:18:24 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-09-04 18:20:21 +0200 |
commit | c0d3b4b032b44d4ceff2f3cabdedd16633f1c315 (patch) | |
tree | 84fdd5875d0bcc92a5a6842dff6ca53148413fac | |
parent | e2a0d178cfc5d552131c518778fa12ce5c5dc930 (diff) | |
download | git-bug-c0d3b4b032b44d4ceff2f3cabdedd16633f1c315.tar.gz |
cache: fix missed code path that should update the cache
fix #36
-rw-r--r-- | cache/repo_cache.go | 7 | ||||
-rw-r--r-- | commands/ls.go | 1 |
2 files changed, 8 insertions, 0 deletions
diff --git a/cache/repo_cache.go b/cache/repo_cache.go index d5dd4c59..d3d02c45 100644 --- a/cache/repo_cache.go +++ b/cache/repo_cache.go @@ -247,6 +247,11 @@ func (c *RepoCache) NewBugWithFiles(title string, message string, files []util.H cached := NewBugCache(c, b) c.bugs[b.Id()] = cached + err = c.bugUpdated(b.Id()) + if err != nil { + return nil, err + } + return cached, nil } @@ -257,11 +262,13 @@ func (c *RepoCache) Fetch(remote string) (string, error) { } func (c *RepoCache) MergeAll(remote string) <-chan bug.MergeResult { + // Todo: update the cache properly return bug.MergeAll(c.repo, remote) } // Pull does a Fetch and merge the updates into the local bug states func (c *RepoCache) Pull(remote string, out io.Writer) error { + // Todo: update the cache properly return bug.Pull(c.repo, out, remote) } diff --git a/commands/ls.go b/commands/ls.go index ea5418c4..18496e06 100644 --- a/commands/ls.go +++ b/commands/ls.go @@ -14,6 +14,7 @@ func runLsBug(cmd *cobra.Command, args []string) error { if err != nil { return err } + defer backend.Close() allIds := backend.AllBugsId(cache.OrderByCreation, cache.OrderAscending) |