From f99e8e787a08c134ce4be552a54e4d0971fec566 Mon Sep 17 00:00:00 2001 From: Jacob Vosmaer Date: Tue, 4 Jun 2019 12:38:58 +0000 Subject: Make catfile cache size configurable --- internal/linguist/linguist.go | 4 ++++ internal/linguist/linguist_test.go | 5 +---- 2 files changed, 5 insertions(+), 4 deletions(-) (limited to 'internal/linguist') 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) -- cgit v1.2.3