On TFS15RC1 it seems Microsoft changed the way in which Git retrieves it's data, which causes at least pull request builds to fail when calling the GitVersion task, if the repository has not fetched the master and/or dev branch before.
If I log in to the build agent's source directory and manually fetch the dev and/or master branch (or all with git fetch -all), the build will work.
2016-08-10T10:32:19.5020593Z ERROR [08/10/16 12:32:19:39] An unexpected error occurred:
2016-08-10T10:32:19.5020593Z System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.
2016-08-10T10:32:19.5020593Z at GitVersion.BranchConfigurationCalculator.InheritBranchConfiguration(Boolean onlyEvaluateTrackedBranches, IRepository repository, Commit currentCommit, Branch currentBranch, KeyValuePair`2 keyValuePair, BranchConfig branchConfiguration, Config config, IList`1 excludedInheritBranches)
2016-08-10T10:32:19.5020593Z at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch, IList`1 excludedInheritBranches)
2016-08-10T10:32:19.5020593Z at GitVersion.GitVersionContext.CalculateEffectiveConfiguration()
2016-08-10T10:32:19.5020593Z at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId)
2016-08-10T10:32:19.5020593Z at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)
2016-08-10T10:32:19.5020593Z at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
2016-08-10T10:32:19.5020593Z at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig)
2016-08-10T10:32:19.5020593Z at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
2016-08-10T10:32:19.5020593Z at GitVersion.Program.VerifyArgumentsAndRun()
Server: TFS15RC1
Agent version: 2.103.1
GitVersion version: 3.6.2
On TFS15RC1 it seems Microsoft changed the way in which Git retrieves it's data, which causes at least pull request builds to fail when calling the GitVersion task, if the repository has not fetched the master and/or dev branch before.
Repro:
Optional:
If I log in to the build agent's source directory and manually fetch the dev and/or master branch (or all with git fetch -all), the build will work.