aboutsummaryrefslogtreecommitdiffstats
path: root/cache/repo_cache.go
diff options
context:
space:
mode:
authorSladyn <gunnerforlife00@gmail.com>2019-02-28 02:49:35 +0530
committerSladyn <gunnerforlife00@gmail.com>2019-03-02 23:04:45 +0530
commit43e56692e832bcb4ef39f745ec9fbaf7360052de (patch)
tree0cae5fa06e23e193d881c94a250ab6205c016c34 /cache/repo_cache.go
parent7260ca05bc3588c0572887a7d8f1b897c7fc13da (diff)
downloadgit-bug-43e56692e832bcb4ef39f745ec9fbaf7360052de.tar.gz
ls.go:`git bug ls` should be faster
Added `Title` to BugExcerpt Added `TitleFilter` to `filter.go` Used BugExcerpt in `ls` command to improve performance. Closes https://github.com/MichaelMure/git-bug/issues/98
Diffstat (limited to 'cache/repo_cache.go')
-rw-r--r--cache/repo_cache.go9
1 files changed, 9 insertions, 0 deletions
diff --git a/cache/repo_cache.go b/cache/repo_cache.go
index 2b0fa360..fd5d0865 100644
--- a/cache/repo_cache.go
+++ b/cache/repo_cache.go
@@ -386,6 +386,15 @@ func (c *RepoCache) ResolveBug(id string) (*BugCache, error) {
return cached, nil
}
+// ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id
+func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) {
+ e, ok := c.excerpts[id]
+ if !ok {
+ return nil, bug.ErrBugNotExist
+ }
+
+ return e, nil
+}
// ResolveBugExcerpt retrieve a BugExcerpt matching the exact given id
func (c *RepoCache) ResolveBugExcerpt(id string) (*BugExcerpt, error) {