mirror of
https://github.com/kata-containers/kata-containers.git
synced 2026-07-01 22:50:54 +00:00
tests: export target_branch="${branch}"
Avoid running "git remote show origin" repeatedly when common.bash gets sourced multiple times and target_branch was not specified by the caller. Repeated "git remote show origin" calls inflicted the additional overhead of authenticating and communicating with the remote git repository. Signed-off-by: Dan Mihai <dmihai@microsoft.com>
This commit is contained in:
@@ -32,6 +32,9 @@ RUNTIME="${RUNTIME:-containerd-shim-kata-v2}"
|
||||
|
||||
export branch="${target_branch:-"$(git remote show origin | sed -n '/HEAD branch/s/.*: //p')"}"
|
||||
|
||||
# Export target_branch to avoid hitting the remote repository again when this script gets loaded again.
|
||||
export target_branch="${branch}"
|
||||
|
||||
function die() {
|
||||
local msg="$*"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user