From b85fc8ed13eab7a3341c3b4394ec22c787fba8ae Mon Sep 17 00:00:00 2001 From: Dan Mihai Date: Sat, 16 May 2026 00:42:29 +0000 Subject: [PATCH] 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 --- tests/common.bash | 3 +++ 1 file changed, 3 insertions(+) diff --git a/tests/common.bash b/tests/common.bash index fbfb0cf416..c9c882876d 100644 --- a/tests/common.bash +++ b/tests/common.bash @@ -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="$*"