Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPatrick Steinhardt <psteinhardt@gitlab.com>2021-03-24 10:43:05 +0300
committerPatrick Steinhardt <psteinhardt@gitlab.com>2021-03-24 10:48:40 +0300
commit3d50d608fef4a2f30e8962088f0aeca74aa56988 (patch)
treece21a11a0b62df6c64d8fa1b3664a128bac15273 /Makefile
parentcc879cfb5db4ed342c4f0ea744dbbfdc9649b35f (diff)
Makefile: Fix libgit2/git builds with old git versions
In order to silence git's warning that the default branch created by git-init(1) may change in the future, we've added the `--initial-branch` to the command in bcd7a5ee3 (Makefile: set --initial-branch=master on "git init", 2021-02-25). Given that this flag has been introduced relatively recent with git v2.28.0, older versions of git cannot build neither the "git" nor the "libgit2" targets now. Fix the issue by instead passing the initial branch via a config entry. These simply get ignored by older versions where the default branch is "master" anyway, and newer versions correctly use it and thus do not print the warning. Furthermore, it also stops the "warning: re-init: ignored --initial-branch=master" warning which gets printed when we reinitialize the repo.
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile4
1 files changed, 2 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 23f642390..9985068b5 100644
--- a/Makefile
+++ b/Makefile
@@ -422,7 +422,7 @@ ${TOOLS_DIR}/%.version: dependency-version | ${TOOLS_DIR}
${Q}[ x"$$(cat "$@" 2>/dev/null)" = x"${TOOL_VERSION}" ] || >$@ echo -n "${TOOL_VERSION}"
${LIBGIT2_INSTALL_DIR}/lib/libgit2.a: ${DEPENDENCY_DIR}/libgit2.version
- ${Q}${GIT} init --initial-branch=master ${GIT_QUIET} ${LIBGIT2_SOURCE_DIR}
+ ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} ${LIBGIT2_SOURCE_DIR}
${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" config remote.origin.url ${LIBGIT2_REPO_URL}
${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" config remote.origin.tagOpt --no-tags
${Q}${GIT} -C "${LIBGIT2_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin ${LIBGIT2_VERSION}
@@ -435,7 +435,7 @@ ${LIBGIT2_INSTALL_DIR}/lib/libgit2.a: ${DEPENDENCY_DIR}/libgit2.version
ifeq (${GIT_USE_PREBUILT_BINARIES},)
${GIT_INSTALL_DIR}/bin/git: ${DEPENDENCY_DIR}/git.version
- ${Q}${GIT} init --initial-branch=master ${GIT_QUIET} ${GIT_SOURCE_DIR}
+ ${Q}${GIT} -c init.defaultBranch=master init ${GIT_QUIET} ${GIT_SOURCE_DIR}
${Q}${GIT} -C "${GIT_SOURCE_DIR}" config remote.origin.url ${GIT_REPO_URL}
${Q}${GIT} -C "${GIT_SOURCE_DIR}" config remote.origin.tagOpt --no-tags
${Q}${GIT} -C "${GIT_SOURCE_DIR}" fetch --depth 1 ${GIT_QUIET} origin ${GIT_VERSION}