in teamcity-premerge-agent/src/main/java/jetbrains/buildServer/premerge/PremergeBuildProcess.java [85:97]
protected void preliminaryMerge() throws VcsException {
targetBranch = PremergeBranchSupport.cutRefsHeads(myRunner.getRunnerParameters().get(PremergeConstants.TARGET_BRANCH));
List<VcsRootEntry> vcsRootEntries = myBuild.getVcsRootEntries();
for (VcsRootEntry entry : vcsRootEntries) {
makeVcsRootPreliminaryMerge(entry.getVcsRoot(), entry.getCheckoutRules().map("."));
}
if (unsuccessfulFetchesCount == vcsRootEntries.size()) {
getBuild().getBuildLogger().error("Fetching all target branches error");
setUnsuccess();
throw new VcsException("Fetching all target branches error");
}
}