diff --git a/test/common/config/pkgdep/git b/test/common/config/pkgdep/git index e82548330..9c4677b68 100644 --- a/test/common/config/pkgdep/git +++ b/test/common/config/pkgdep/git @@ -245,6 +245,15 @@ function install_libiscsi() { } function install_git() { + if type -P git; then + if [[ $(sort -V) == "$GIT_VERSION"* ]]; then + # Our version is on top, meaning there's a newer git version installed + # or we already have matching one on board. Either way, we don't need + # to do anything, return. + return 0 + fi <<< "$GIT_VERSION"$'\n'"$(git --version)" + fi >/dev/null + install zlib-devel curl-devel tar -C "$GIT_REPOS" -xzof <(wget -qO- "$GIT_REPO_GIT") (cd "$GIT_REPOS/git-$GIT_VERSION" \