diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-12-20 14:40:19 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2022-12-20 15:25:38 +0300 |
commit | 64f30e48224306308d9b00b706d7961985cdecc8 (patch) | |
tree | c4a993aac63d0931dab4a4711639ad9f63e3a5a9 | |
parent | 2bc64b5e1f449aadb2de37d2b70ebdf5c954c799 (diff) |
git/objectpool: Stop explicitly removing hooks
When creating repositories Git will install files present in a specific
templates directory into the newly created repository. This includes
some stubs like `info/exclude` and `description`, but also a set of
sample hooks. While these files are tiny on their own, they do add up
when installed across millions of repositories. We have thus overridden
`init.templateDir` in bd0f89954 (git: Do not install templates when
creating repos, 2021-10-28) so that we don't install these templates
anymore.
One left-over bit from before that time is that we still manually delete
the `hooks` directory when creating object pools. This is not necessary
anymore though, so let's drop this logic. Note that we have preexisting
tests that verify there is indeed no `hooks` directory after creating
the object pool in `TestCreate/successful`.
-rw-r--r-- | internal/git/objectpool/create.go | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/internal/git/objectpool/create.go b/internal/git/objectpool/create.go index 1117825f8..b523f8124 100644 --- a/internal/git/objectpool/create.go +++ b/internal/git/objectpool/create.go @@ -6,7 +6,6 @@ import ( "errors" "fmt" "os" - "path/filepath" "gitlab.com/gitlab-org/gitaly/v15/internal/git" "gitlab.com/gitlab-org/gitaly/v15/internal/git/catfile" @@ -73,10 +72,6 @@ func Create( return nil, fmt.Errorf("cloning to pool: %w, stderr: %q", err, stderr.String()) } - if err := os.RemoveAll(filepath.Join(objectPoolPath, "hooks")); err != nil { - return nil, fmt.Errorf("removing hooks: %v", err) - } - objectPool, err := FromProto(locator, gitCmdFactory, catfileCache, txManager, housekeepingManager, proto) if err != nil { return nil, err |