refs: call branches branches

These things in refs/heads/ hierarchy are called "branches" in human parlance. Replace REF_HEADS with REF_BRANCHES to make it clearer. No end-user visible change intended at this step. Signed-off-by: Junio C Hamano <gitster@pobox.com>

Junio C Hamano committed Jun 4, 2024 at 15:01 UTC a096e70c78353e338975b880b7468b79b819f291
3 files changed +5 -5
builtin/ls-remote.c
+2 -2
@@ -68,7 +68,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
68 N_("path of git-upload-pack on the remote host"),
69 PARSE_OPT_HIDDEN },
70 OPT_BIT('t', "tags", &flags, N_("limit to tags"), REF_TAGS),
71 - OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_HEADS),
71 + OPT_BIT('h', "heads", &flags, N_("limit to heads"), REF_BRANCHES),
72 OPT_BIT(0, "refs", &flags, N_("do not show peeled tags"), REF_NORMAL),
73 OPT_BOOL(0, "get-url", &get_url,
74 N_("take url.<base>.insteadOf into account")),
@@ -100,7 +100,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
100
101 if (flags & REF_TAGS)
102 strvec_push(&transport_options.ref_prefixes, "refs/tags/");
103 - if (flags & REF_HEADS)
103 + if (flags & REF_BRANCHES)
104 strvec_push(&transport_options.ref_prefixes, "refs/heads/");
105
106 remote = remote_get(dest);
connect.c
+2 -2
@@ -38,8 +38,8 @@ static int check_ref(const char *name, unsigned int flags)
38 REFNAME_ALLOW_ONELEVEL))
39 return 0;
40
41 - /* REF_HEADS means that we want regular branch heads */
42 - if ((flags & REF_HEADS) && starts_with(name, "heads/"))
41 + /* REF_BRANCHES means that we want regular branch heads */
42 + if ((flags & REF_BRANCHES) && starts_with(name, "heads/"))
43 return 1;
44
45 /* REF_TAGS means that we want tags */
remote.h
+1 -1
@@ -200,7 +200,7 @@ struct ref {
200 };
201
202 #define REF_NORMAL (1u << 0)
203 -#define REF_HEADS (1u << 1)
203 +#define REF_BRANCHES (1u << 1)
204 #define REF_TAGS (1u << 2)
205
206 struct ref *find_ref_by_name(const struct ref *list, const char *name);