{"action":"created","issue":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/996","repository_url":"https://api.github.com/repos/GitTools/GitVersion","labels_url":"https://api.github.com/repos/GitTools/GitVersion/issues/996/labels{/name}","comments_url":"https://api.github.com/repos/GitTools/GitVersion/issues/996/comments","events_url":"https://api.github.com/repos/GitTools/GitVersion/issues/996/events","html_url":"https://github.com/GitTools/GitVersion/issues/996","id":170387751,"number":996,"title":"3.6.2: TFS15RC1: An unexpected error occurred: System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.","user":{"login":"nphmuller","id":3781551,"avatar_url":"https://avatars.githubusercontent.com/u/3781551?v=3","gravatar_id":"","url":"https://api.github.com/users/nphmuller","html_url":"https://github.com/nphmuller","followers_url":"https://api.github.com/users/nphmuller/followers","following_url":"https://api.github.com/users/nphmuller/following{/other_user}","gists_url":"https://api.github.com/users/nphmuller/gists{/gist_id}","starred_url":"https://api.github.com/users/nphmuller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nphmuller/subscriptions","organizations_url":"https://api.github.com/users/nphmuller/orgs","repos_url":"https://api.github.com/users/nphmuller/repos","events_url":"https://api.github.com/users/nphmuller/events{/privacy}","received_events_url":"https://api.github.com/users/nphmuller/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/GitTools/GitVersion/labels/Build%20Server:%20TFS%20/%20Team%20Services","name":"Build Server: TFS / Team Services","color":"d4c5f9"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-08-10T10:48:21Z","updated_at":"2016-08-11T01:26:56Z","closed_at":null,"body":"Server: TFS15RC1\r\nAgent version: 2.103.1\r\nGitVersion version: 3.6.2\r\n\r\nOn 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.\r\n\r\nRepro:\r\n- Create a build definition and add at least the GitVersion task. I had a release branch as default in the build definition (releases/3.0), but I don't think this matters.\r\n- Select this build definition in the branch policy in 'Automatically build pull requests'.\r\n- Create a pull request and the GitVersion build task fails. (See log output below).\r\n\r\nOptional:\r\n- If you want the repro to keep working (even after manually fetching the dev and/or master branch) add the Build.Clean=source variable to the build definition.\r\n\r\nIf 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.\r\n\r\n```\r\n2016-08-10T10:32:19.5020593Z ERROR [08/10/16 12:32:19:39] An unexpected error occurred:\r\n2016-08-10T10:32:19.5020593Z System.InvalidOperationException: Could not find a 'develop' or 'master' branch, neither locally nor remotely.\r\n2016-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)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch, IList`1 excludedInheritBranches)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.GitVersionContext.CalculateEffectiveConfiguration()\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.ExecuteCore.<>c__DisplayClass6_0.<ExecuteInternal>b__0(IRepository repo)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)\r\n2016-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)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)\r\n2016-08-10T10:32:19.5020593Z    at GitVersion.Program.VerifyArgumentsAndRun()\r\n```"},"comment":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/comments/239052170","html_url":"https://github.com/GitTools/GitVersion/issues/996#issuecomment-239052170","issue_url":"https://api.github.com/repos/GitTools/GitVersion/issues/996","id":239052170,"user":{"login":"JakeGinnivan","id":453152,"avatar_url":"https://avatars.githubusercontent.com/u/453152?v=3","gravatar_id":"","url":"https://api.github.com/users/JakeGinnivan","html_url":"https://github.com/JakeGinnivan","followers_url":"https://api.github.com/users/JakeGinnivan/followers","following_url":"https://api.github.com/users/JakeGinnivan/following{/other_user}","gists_url":"https://api.github.com/users/JakeGinnivan/gists{/gist_id}","starred_url":"https://api.github.com/users/JakeGinnivan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/JakeGinnivan/subscriptions","organizations_url":"https://api.github.com/users/JakeGinnivan/orgs","repos_url":"https://api.github.com/users/JakeGinnivan/repos","events_url":"https://api.github.com/users/JakeGinnivan/events{/privacy}","received_events_url":"https://api.github.com/users/JakeGinnivan/received_events","type":"User","site_admin":false},"created_at":"2016-08-11T01:26:56Z","updated_at":"2016-08-11T01:26:56Z","body":"@asbjornu why is it cloning your fork:\r\n\r\ngit clone --depth=50 --branch=feature/mkdocs-build https://github.com/asbjornu/GitVersion.git asbjornu/GitVersion\r\n\r\nCould that be the issue?"}}
{"actor":{"display_login":"JakeGinnivan"}}