diff options
author | Stan Hu <stanhu@gmail.com> | 2021-02-23 23:02:49 +0300 |
---|---|---|
committer | Stan Hu <stanhu@gmail.com> | 2021-02-24 00:09:43 +0300 |
commit | f222a95067243dce570f4221389000a9b3fc900c (patch) | |
tree | 3e891b3ba23639e33be511c17966fadf2bf54cdd | |
parent | 729a48b744350fc9a52a6091aeeafd10cdf5ca4c (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-- | Makefile | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -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} |