]> git.ipfire.org Git - thirdparty/git.git/commit
refs: drop `git_default_branch_name()`
authorPatrick Steinhardt <ps@pks.im>
Fri, 17 May 2024 08:19:09 +0000 (10:19 +0200)
committerJunio C Hamano <gitster@pobox.com>
Fri, 17 May 2024 17:33:39 +0000 (10:33 -0700)
commit97abaab5f6390ccb3e55c8b63c9087be7b1fc1d7
tree6b6c75c1e7f25862626adbc8b83de1037a411382
parent30aaff437fddd889ba429b50b96ea4c151c502c5
refs: drop `git_default_branch_name()`

The `git_default_branch_name()` function is a thin wrapper around
`repo_default_branch_name()` with two differences:

  - We implicitly rely on `the_repository`.

  - We cache the default branch name.

None of the callsites of `git_default_branch_name()` are hot code paths
though, so the caching of the branch name is not really required.

Refactor the callsites to use `repo_default_branch_name()` instead and
drop `git_default_branch_name()`, thus getting rid of one more case
where we rely on `the_repository`.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/clone.c
builtin/var.c
refs.c
refs.h
remote.c
setup.c