factory.addStep(ShellCommand(
name = "switchbranch",
description = "Checking out Git branch",
- command = ["git", "checkout", repo_branch],
+ command = "if [ -d .git ]; then git checkout '%s'; else exit 0; fi" % repo_branch,
haltOnFailure = True,
doStepIf = IsNoTaggingRequested
))