mirror of
https://github.com/Mbed-TLS/mbedtls.git
synced 2025-04-01 04:20:45 +00:00
test: add GIT alternative commands for older GIT versions
The Docker container used for the CI has Git version 2.7.4 which does not support the "git branch --show-current" command since this was added in version 2.22. Therefore this commit adds an alternative version for old Git versions. Signed-off-by: Valerio Setti <valerio.setti@nordicsemi.no>
This commit is contained in:
parent
43cef57e51
commit
ccb0344969
@ -43,8 +43,15 @@ record() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
# save current HEAD
|
# save current HEAD.
|
||||||
HEAD=$(git branch --show-current)
|
# Note: unfortunately "git branch --show-current" was added only in GIT
|
||||||
|
# version 2.22.
|
||||||
|
GIT_VERSION="$(git --version | sed 's/git version //')"
|
||||||
|
if dpkg --compare-versions "$GIT_VERSION" "gt" "2.22.0"; then
|
||||||
|
HEAD=$(git branch --show-current)
|
||||||
|
else
|
||||||
|
HEAD=$(git rev-parse --abbrev-ref HEAD)
|
||||||
|
fi
|
||||||
|
|
||||||
# get the numbers before this PR for default and full
|
# get the numbers before this PR for default and full
|
||||||
cleanup
|
cleanup
|
||||||
|
Loading…
x
Reference in New Issue
Block a user