on master help sign in
[fix] support git versions <v2.22

LTS distros like Ubuntu 18.04 do not ship a up-to-date version of git.:: $ sudo -H ./utils/lxc.sh cmd searx-ubu1804 git --version ... git version 2.17.1 The option `--show-current` was added in git v2.22, the alternative to this option is:: git rev-parse --abbrev-ref HEAD Issue when using option `--show-current`:: [searx-ubu1804] Clone searx sources [searx-ubu1804] ------------------- [searx-ubu1804] [searx-ubu1804] error: unknown option `show-current' [searx-ubu1804] usage: git branch [<options>] [-r | -a] [--merged | --no-merged] .... Signed-off-by: Markus Heiser <markus.heiser@darmarit.de>

commit237b1cfdb378187cdf597a328e28a64ab694012d authorMarkus Heiser <markus.heiser@darmarit.de> dateWed 3 Mar 2021, 18:22 (6 years ago) parentc748fc6
1 file changed+2−2
utils/searx.sh+2−2
utils/searx.sh+2−2
@@ -394,8 +394,8 @@ clone_searx() {
394394 info_msg "create local branch ${GIT_BRANCH} from start point: origin/${GIT_BRANCH}"
395395 git branch "${GIT_BRANCH}" "origin/${GIT_BRANCH}"
396396 fi
397− if [[ ! $(git branch --show-current) == "${GIT_BRANCH}" ]]; then
398− warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git branch --show-current)"
397+ if [[ ! $(git rev-parse --abbrev-ref HEAD) == "${GIT_BRANCH}" ]]; then
398+ warn_msg "take into account, installing branch $GIT_BRANCH while current branch is $(git rev-parse --abbrev-ref HEAD)"
399399 fi
400400 export SERVICE_HOME
401401 git_clone "$REPO_ROOT" "$SEARX_SRC" \