From c940af1f2c98de053ee90b4a878ff95a55380882 Mon Sep 17 00:00:00 2001 From: Vector Li Date: Thu, 12 Jan 2023 10:07:38 +0800 Subject: [PATCH] Use macro GIT_BRANCHES Signed-off-by: Vector Li --- src/fetch_git.c | 5 +---- src/fetch_git.h | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/src/fetch_git.c b/src/fetch_git.c index 296a8874..b87bb97a 100644 --- a/src/fetch_git.c +++ b/src/fetch_git.c @@ -30,10 +30,7 @@ #include "fetch.h" #include "fetch_git.h" -// The main branch ("main") is fetched by default, but we also support to -// fetch the legacy one (i.e. "master") because it is required by some old -// repositories. -static const gchar *g_git_branches[] = {"main", "master"}; +static const gchar *g_git_branches[] = {GIT_BRANCHES}; static gint packet_length(const gchar *linelen) diff --git a/src/fetch_git.h b/src/fetch_git.h index 83a73fb6..5d3ee979 100644 --- a/src/fetch_git.h +++ b/src/fetch_git.h @@ -18,6 +18,12 @@ #ifndef _RESTRAINT_FETCH_GIT_H #define _RESTRAINT_FETCH_GIT_H +/* + * The main branch ("main") is fetched by default, but we also support to + * fetch the legacy one (i.e. "master") because it is required by some old + * repositories. + */ +#define GIT_BRANCHES "main", "master" #define GIT_PORT 9418 #define HDR_LEN_SIZE 4