diff options
author | Derrick Stolee <derrickstolee@github.com> | 2022-08-05 19:58:36 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2022-08-05 23:13:12 +0200 |
commit | b9342b3fd6308c351f53075c9c4339913b73451f (patch) | |
tree | ef50c609adb612e0ddb04f3ef0e72bfd8f3490c2 /environment.c | |
parent | t4207: test coloring of grafted decorations (diff) | |
download | git-b9342b3fd6308c351f53075c9c4339913b73451f.tar.xz git-b9342b3fd6308c351f53075c9c4339913b73451f.zip |
refs: add array of ref namespaces
Git interprets different meanings to different refs based on their
names. Some meanings are cosmetic, like how refs in 'refs/remotes/*'
are colored differently from refs in 'refs/heads/*'. Others are more
critical, such as how replace refs are interpreted.
Before making behavior changes based on ref namespaces, collect all
known ref namespaces into a array of ref_namespace_info structs. This
array is indexed by the new ref_namespace enum for quick access.
As of this change, this array is purely documentation. Future changes
will add dependencies on this array.
Signed-off-by: Derrick Stolee <derrickstolee@github.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'environment.c')
-rw-r--r-- | environment.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/environment.c b/environment.c index b3296ce7d1..9eb22f975c 100644 --- a/environment.c +++ b/environment.c @@ -185,6 +185,8 @@ void setup_git_env(const char *git_dir) free(git_replace_ref_base); git_replace_ref_base = xstrdup(replace_ref_base ? replace_ref_base : "refs/replace/"); + update_ref_namespace(NAMESPACE_REPLACE, git_replace_ref_base); + free(git_namespace); git_namespace = expand_namespace(getenv(GIT_NAMESPACE_ENVIRONMENT)); shallow_file = getenv(GIT_SHALLOW_FILE_ENVIRONMENT); |