| 1045 | } |
| 1046 | |
| 1047 | static const struct string_list *protocol_allow_list(void) |
| 1048 | { |
| 1049 | static int enabled = -1; |
| 1050 | static struct string_list allowed = STRING_LIST_INIT_DUP; |
| 1051 | |
| 1052 | if (enabled < 0) { |
| 1053 | const char *v = getenv("GIT_ALLOW_PROTOCOL"); |
| 1054 | if (v) { |
| 1055 | string_list_split(&allowed, v, ":", -1); |
| 1056 | string_list_sort(&allowed); |
| 1057 | enabled = 1; |
| 1058 | } else { |
| 1059 | enabled = 0; |
| 1060 | } |
| 1061 | } |
| 1062 | |
| 1063 | return enabled ? &allowed : NULL; |
| 1064 | } |
| 1065 | |
| 1066 | enum protocol_allow_config { |
| 1067 | PROTOCOL_ALLOW_NEVER = 0, |
no test coverage detected