Skip to content

Commit d419378

Browse files
authored
Merge pull request #356 from bssrikanth/fix_branchcheckout
Fix branch checkout for tests
2 parents 0cc1cc2 + c680e42 commit d419378

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

avocado-setup.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@ def get_repo(repo, basepath):
214214
branch = "master"
215215
else:
216216
branch = repo[1]
217-
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
217+
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
218218
repo_name = repo[0].split('/')[-1].split('.git')[0]
219219
repo_path = os.path.join(basepath, repo_name)
220220
cmd_clone = "git clone %s %s" % (repo[0], repo_path)

0 commit comments

Comments
 (0)