salt.sh: Rework `git -C` for older git compat 17/47717/1
authorAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 23 Nov 2017 14:41:39 +0000 (15:41 +0100)
committerAlexandru Avadanii <Alexandru.Avadanii@enea.com>
Thu, 23 Nov 2017 14:41:39 +0000 (15:41 +0100)
CentOS 7.4 provides git 1.8.3, while `git -C` support was introduced
in 1.8.5, so rework <salt.sh> to not rely on this parameter.

Change-Id: Ied88466b2b3d91a3317922fa08f60afe934358a0
Signed-off-by: Alexandru Avadanii <Alexandru.Avadanii@enea.com>
mcp/scripts/salt.sh

index 631cc4a..ab096f3 100755 (executable)
@@ -12,7 +12,7 @@
 
 CI_DEBUG=${CI_DEBUG:-0}; [[ "${CI_DEBUG}" =~ (false|0) ]] || set -x
 F_GIT_ROOT=$(git rev-parse --show-toplevel)
-F_GIT_DIR=$(git -C "${F_GIT_ROOT}/mcp" rev-parse --git-dir)
+F_GIT_DIR=$(cd "${F_GIT_ROOT}/mcp" && git rev-parse --git-dir)
 F_GIT_SUBD=${F_GIT_ROOT#${F_GIT_DIR%%/.git*}}
 OPNFV_TMP_DIR="/home/${SALT_MASTER_USER}/opnfv"
 OPNFV_GIT_DIR="/root/opnfv"