From c680e42770af5c561bb42dc7c3cf03dede027468 Mon Sep 17 00:00:00 2001 From: Srikanth Aithal Date: Fri, 11 Apr 2025 08:37:02 +0000 Subject: [PATCH] Fix branch checkout for tests Currently branch checkout fails for tests. This commit fixes it. Signed-off-by: Srikanth Aithal --- avocado-setup.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/avocado-setup.py b/avocado-setup.py index bde34a5c..9921b496 100644 --- a/avocado-setup.py +++ b/avocado-setup.py @@ -214,7 +214,7 @@ def get_repo(repo, basepath): branch = "master" else: branch = repo[1] - cmd_update = "b=%s;git reset --hard && git checkout master && git remote update && (git branch|grep $b||(git checkout $b && git switch -c $b))" % branch + cmd_update = "b=%s;git reset --hard && git checkout master && git remote update && (git branch | grep -w $b && (git switch $b && git pull origin $b --rebase) || (git fetch origin && git switch -c $b origin/$b) || echo \"Error: Could not sync with origin/$b\")" % branch repo_name = repo[0].split('/')[-1].split('.git')[0] repo_path = os.path.join(basepath, repo_name) cmd_clone = "git clone %s %s" % (repo[0], repo_path)