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:
authorStan Hu <stanhu@gmail.com>2021-02-23 23:02:49 +0300
committerStan Hu <stanhu@gmail.com>2021-02-24 00:09:43 +0300
commitf222a95067243dce570f4221389000a9b3fc900c (patch)
tree3e891b3ba23639e33be511c17966fadf2bf54cdd
parent729a48b744350fc9a52a6091aeeafd10cdf5ca4c (diff)
Fix handling of libgit2 build updates
If the libgit2 version is updated from an existing directory in `_build/deps/libgit2`, previously we would fetch the branch but the current version would remain intact. We now call a `git switch` to switch to the proper branch. This came out of https://gitlab.com/gitlab-org/gitaly/-/merge_requests/3181. To test, switch between `master` and that branch and run `make test`.
-rw-r--r--Makefile1
1 files changed, 1 insertions, 0 deletions
diff --git a/Makefile b/Makefile
index 62a2e6e75..da147abc3 100644
--- a/Makefile
+++ b/Makefile
@@ -411,6 +411,7 @@ ${LIBGIT2_INSTALL_DIR}/lib/libgit2.a: ${DEPENDENCY_DIR}/libgit2.version
elif ! git -C "${LIBGIT2_SOURCE_DIR}" rev-parse --quiet --verify ${LIBGIT2_VERSION}^{tree} >/dev/null; then \
${GIT} -C "${LIBGIT2_SOURCE_DIR}" fetch --quiet ${LIBGIT2_REPO_URL} ${LIBGIT2_VERSION}; \
fi
+ ${GIT} -C "${LIBGIT2_SOURCE_DIR}" switch --quiet --detach ${LIBGIT2_VERSION}
${Q}rm -rf ${LIBGIT2_BUILD_DIR}
${Q}mkdir -p ${LIBGIT2_BUILD_DIR}
${Q}cd ${LIBGIT2_BUILD_DIR} && cmake ${LIBGIT2_SOURCE_DIR} ${LIBGIT2_BUILD_OPTIONS}