diff options
| author | Patrick Steinhardt <ps@pks.im> | 2025-11-19 08:50:57 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-25 12:16:00 -0800 |
| commit | c257bd59165e2f55dfa2c97b0ca1e39131513654 (patch) | |
| tree | 71da1a21f99a19e0d3c99e0b5da7bf53a894d76a /chdir-notify.c | |
| parent | eea83c010cf431325a05f06cc7c64029538c8495 (diff) | |
| download | git-c257bd59165e2f55dfa2c97b0ca1e39131513654.tar.gz | |
http-push: stop setting up `the_repository` for each reference
When pushing references via HTTP we call `repo_init_revisions()` in a
loop for each reference that we're about to push. As third argument we
pass the result of `setup_git_directory()`, which causes us to
reinitialize the repository every single time.
This is an obvious waste of compute, as the repository that we're
working in will never change across any of the initializations. The only
reason that we do this is to retrieve the directory of the repository.
Furthermore, this is about to create issues in a subsequent commit,
where reinitializing the repository will cause a `BUG()`.
Address this by storing the Git directory in a variable instead so that
we don't have to call the function repeatedly.
Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'chdir-notify.c')
0 files changed, 0 insertions, 0 deletions
