diff options
author | Derrick Stolee <derrickstolee@github.com> | 2022-08-05 19:58:37 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-05 23:13:12 +0200 |
commit | 97e61e0f9cd96f403504ec97cfdf38f238777560 (patch) | |
tree | 2ad031cf850eae3080ada2e74e5aa51ee092048d /refs.c | |
parent | refs: add array of ref namespaces (diff) | |
download | git-97e61e0f9cd96f403504ec97cfdf38f238777560.tar.xz git-97e61e0f9cd96f403504ec97cfdf38f238777560.zip |
refs: use ref_namespaces for replace refs base
The git_replace_ref_base global is used to store the value of the
GIT_REPLACE_REF_BASE environment variable or the default of
"refs/replace/". This is initialized within setup_git_env().
The ref_namespaces array is a new centralized location for information
such as the ref namespace used for replace refs. Instead of having this
namespace stored in two places, use the ref_namespaces array instead.
For simplicity, create a local git_replace_ref_base variable wherever
the global was previously used.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'refs.c')
-rw-r--r-- | refs.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -1612,6 +1612,7 @@ int refs_for_each_fullref_in(struct ref_store *refs, const char *prefix, int for_each_replace_ref(struct repository *r, each_repo_ref_fn fn, void *cb_data) { + const char *git_replace_ref_base = ref_namespace[NAMESPACE_REPLACE].ref; return do_for_each_repo_ref(r, git_replace_ref_base, fn, strlen(git_replace_ref_base), DO_FOR_EACH_INCLUDE_BROKEN, cb_data); |