git: Pick same cgroups more often
Cgroups get picked either based on the gitalypb.Repository
, if set, or otherwise by hashing the complete command line. This means that depending on whether a repository is present or not we'd typically pick different cgroups, and thus a single repository may create load in multiple different cgroups. This is of course not great, as it increases the impact a single repository can have.
This MR thus refactors most callers of NewWithoutRepo()
and all callers of NewWithDir()
to use New()
instead. As a result we now also spawn git-receive-pack(1), git-upload-pack(1), git-upload-archive(1) and the commands executed in worktrees in UserApplyPatch
in the same cgroup. There still are some callers left that use NewWithoutRepo()
: it's basically all RPCs that create a new repository, and git.CheckRefFormat()
. They may or may not be converted at a later point.