diff options
| author | Jialong Wang <jerrywang183@yahoo.com> | 2026-03-18 15:09:42 -0400 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2026-03-18 12:52:29 -0700 |
| commit | c5fc44f54595f123c277e5839cbafa1bc9c8c050 (patch) | |
| tree | 4956573f4efd25c79ae9f535e192d97fbeaca8a7 /object-name.c | |
| parent | ca1db8a0f7dc0dbea892e99f5b37c5fe5861be71 (diff) | |
| download | git-c5fc44f54595f123c277e5839cbafa1bc9c8c050.tar.xz | |
object-name: turn INTERPRET_BRANCH_* constants into enum values
Replace the INTERPRET_BRANCH_* preprocessor constants with enum
values and use that type where these flags are stored or passed
around.
These flags describe which kinds of branches may be considered during
branch-name interpretation, so represent them as an enum describing
branch kinds while keeping the existing bitmask semantics and
INTERPRET_BRANCH_* element names.
Signed-off-by: Jialong Wang <jerrywang183@yahoo.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'object-name.c')
| -rw-r--r-- | object-name.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/object-name.c b/object-name.c index 7b14c3bf9b..2b2a0435fd 100644 --- a/object-name.c +++ b/object-name.c @@ -1660,7 +1660,8 @@ static int interpret_empty_at(const char *name, int namelen, int len, struct str static int reinterpret(struct repository *r, const char *name, int namelen, int len, - struct strbuf *buf, unsigned allowed) + struct strbuf *buf, + enum interpret_branch_kind allowed) { /* we have extra data, which might need further processing */ struct strbuf tmp = STRBUF_INIT; @@ -1692,7 +1693,8 @@ static void set_shortened_ref(struct repository *r, struct strbuf *buf, const ch free(s); } -static int branch_interpret_allowed(const char *refname, unsigned allowed) +static int branch_interpret_allowed(const char *refname, + enum interpret_branch_kind allowed) { if (!allowed) return 1; |
