diff --git a/jenkins/scripts/release-tools/functions b/jenkins/scripts/release-tools/functions index d093345cf1..778e0a81e9 100644 --- a/jenkins/scripts/release-tools/functions +++ b/jenkins/scripts/release-tools/functions @@ -93,9 +93,14 @@ function clone_repo { # them for building the release notes. (cd $repo && git fetch -v --tags) - # Make sure the active branch is set correctly. + # Make sure the active branch is set correctly, if the branch + # exists. if [ ! -z "$branch" ]; then - (cd $repo && git checkout $branch) + if git show origin/$branch; then + (cd $repo && git checkout $branch) + else + echo "Branch $branch does not exist, using master." + fi fi return 0