summaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMichael Muré <batolettre@gmail.com>2022-06-18 22:44:28 +0200
committerGitHub <noreply@github.com>2022-06-18 22:44:28 +0200
commitb694052c46a69b47e58526068109db2fbcca92af (patch)
treef0b98f91c19ccb726a4a94d1920d11bb2d93d98e
parentf80910891e4fdb7f03d7993da25e48ccdecaecb7 (diff)
parent295da9c70f6cedb1394c2fa04c0b48a49448e8da (diff)
downloadgit-bug-b694052c46a69b47e58526068109db2fbcca92af.tar.gz
git-bug-b694052c46a69b47e58526068109db2fbcca92af.zip
Merge pull request #807 from MichaelMure/default-repo-name
cache: ensure that the default repo has a non-empty name to make js/apollo happy
-rw-r--r--cache/multi_repo_cache.go3
-rw-r--r--webui/src/apollo.ts2
2 files changed, 3 insertions, 2 deletions
diff --git a/cache/multi_repo_cache.go b/cache/multi_repo_cache.go
index 726558d9b..659cd5e65 100644
--- a/cache/multi_repo_cache.go
+++ b/cache/multi_repo_cache.go
@@ -7,6 +7,7 @@ import (
)
const lockfile = "lock"
+const defaultRepoName = "__default"
// MultiRepoCache is the root cache, holding multiple RepoCache.
type MultiRepoCache struct {
@@ -37,7 +38,7 @@ func (c *MultiRepoCache) RegisterDefaultRepository(repo repository.ClockedRepo)
return nil, err
}
- c.repos[""] = r
+ c.repos[defaultRepoName] = r
return r, nil
}
diff --git a/webui/src/apollo.ts b/webui/src/apollo.ts
index c111dbd8e..3482df541 100644
--- a/webui/src/apollo.ts
+++ b/webui/src/apollo.ts
@@ -9,7 +9,7 @@ const client = new ApolloClient({
typePolicies: {
// TODO: For now, we only query the default repository, so consider it as a singleton
Repository: {
- keyFields: [],
+ keyFields: ['name'],
},
},
}),