diff options
author | Jacob Vosmaer <jacob@gitlab.com> | 2019-06-04 15:38:58 +0300 |
---|---|---|
committer | Jacob Vosmaer <jacob@gitlab.com> | 2019-06-04 15:38:58 +0300 |
commit | f99e8e787a08c134ce4be552a54e4d0971fec566 (patch) | |
tree | 36d0509d914b47d911058d7d7ad5ab00de5f4a93 /internal/linguist | |
parent | 0ebda59da1bc8285645499a24268a54f2170b7d0 (diff) |
Make catfile cache size configurable
Diffstat (limited to 'internal/linguist')
-rw-r--r-- | internal/linguist/linguist.go | 4 | ||||
-rw-r--r-- | internal/linguist/linguist_test.go | 5 |
2 files changed, 5 insertions, 4 deletions
diff --git a/internal/linguist/linguist.go b/internal/linguist/linguist.go index 13d9ed8af..8ce217e4c 100644 --- a/internal/linguist/linguist.go +++ b/internal/linguist/linguist.go @@ -15,6 +15,10 @@ import ( "gitlab.com/gitlab-org/gitaly/internal/config" ) +func init() { + config.RegisterHook(LoadColors) +} + var ( colorMap = make(map[string]Language) ) diff --git a/internal/linguist/linguist_test.go b/internal/linguist/linguist_test.go index aac91d866..8522c6f45 100644 --- a/internal/linguist/linguist_test.go +++ b/internal/linguist/linguist_test.go @@ -6,12 +6,10 @@ import ( "github.com/stretchr/testify/require" "gitlab.com/gitlab-org/gitaly/internal/config" - "gitlab.com/gitlab-org/gitaly/internal/testhelper" + _ "gitlab.com/gitlab-org/gitaly/internal/testhelper" // Side effect: set up config.Config ) func TestLoadLanguages(t *testing.T) { - testhelper.ConfigureRuby() - colorMap = make(map[string]Language) require.NoError(t, LoadColors(), "load colors") @@ -22,7 +20,6 @@ func TestLoadLanguagesCustomPath(t *testing.T) { jsonPath, err := filepath.Abs("testdata/fake-languages.json") require.NoError(t, err) - testhelper.ConfigureRuby() config.Config.Ruby.LinguistLanguagesPath = jsonPath colorMap = make(map[string]Language) |