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