{"action":"created","issue":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/674","labels_url":"https://api.github.com/repos/GitTools/GitVersion/issues/674/labels{/name}","comments_url":"https://api.github.com/repos/GitTools/GitVersion/issues/674/comments","events_url":"https://api.github.com/repos/GitTools/GitVersion/issues/674/events","html_url":"https://github.com/GitTools/GitVersion/issues/674","id":110229146,"number":674,"title":"GitVersion.Portable 3.1.2: NullReferenceException","user":{"login":"asbjornu","id":12283,"avatar_url":"https://avatars.githubusercontent.com/u/12283?v=3","gravatar_id":"","url":"https://api.github.com/users/asbjornu","html_url":"https://github.com/asbjornu","followers_url":"https://api.github.com/users/asbjornu/followers","following_url":"https://api.github.com/users/asbjornu/following{/other_user}","gists_url":"https://api.github.com/users/asbjornu/gists{/gist_id}","starred_url":"https://api.github.com/users/asbjornu/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asbjornu/subscriptions","organizations_url":"https://api.github.com/users/asbjornu/orgs","repos_url":"https://api.github.com/users/asbjornu/repos","events_url":"https://api.github.com/users/asbjornu/events{/privacy}","received_events_url":"https://api.github.com/users/asbjornu/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-07T13:46:40Z","updated_at":"2015-10-07T13:58:10Z","closed_at":null,"body":"When running `gitversion.exe` in a repository, it crashes with the following output:\r\n\r\n```shell\r\nINFO [10/07/15 15:40:31:88] Working directory: C:\\Redacted\r\nINFO [10/07/15 15:40:31:91] Project root is: C:\\Redacted\r\nINFO [10/07/15 15:40:31:96] Using latest commit on specified branch\r\nINFO [10/07/15 15:40:31:96] Begin: Attempting to inherit branch configuration from parent branch\r\n  INFO [10/07/15 15:40:31:98] Begin: Finding branch source\r\n  INFO [10/07/15 15:40:32:02] End: Finding branch source (Took: 40.94ms)\r\nINFO [10/07/15 15:40:32:02] End: Attempting to inherit branch configuration from parent branch (Took: 56.89ms)\r\nERROR [10/07/15 15:40:32:02] An unexpected error occurred:\r\nSystem.NullReferenceException: Object reference not set to an instance of an object.\r\n   at GitVersion.LibGitExtensions.<>c__DisplayClass3_0.<FindCommitBranchWasBranchedFrom>b__1(Branchb)\r\n   at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\r\n   at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\r\n   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\r\n   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\r\n   at GitVersion.LibGitExtensions.FindCommitBranchWasBranchedFrom(Branch branch, IRepository repository, Branch[] excludedBranches)\r\n   at GitVersion.BranchConfigurationCalculator.InheritBranchConfiguration(Boolean onlyEvaluateTrackedBranches, IRepository repository, Commit currentCommit, Branch currentBranch, KeyValuePair`2 keyValuePair, BranchConfig branchConfiguration, Config config, IList`1 excludedInheritBranches)\r\n   at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch, IList`1 excludedInheritBranches)\r\n   at GitVersion.GitVersionContext.CalculateEffectiveConfiguration()\r\n   at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId)\r\n   at GitVersion.GitVersionContext..ctor(IRepository repository, Config configuration, Boolean isForTrackingBranchOnly, String commitId)\r\n   at GitVersion.ExecuteCore.ExecuteGitVersion(IFileSystem fileSystem, String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)\r\n   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)\r\n   at GitVersion.Program.VerifyArgumentsAndRun()\r\nINFO [10/07/15 15:40:32:02]\r\nINFO [10/07/15 15:40:32:02] Here is the current git graph (please include in issue):\r\nINFO [10/07/15 15:40:32:02] Showing max of 100 commits\r\nINFO [10/07/15 15:40:32:12] * a461a04 51 minutes ago  (HEAD -> feature/gitversion)\r\n* 37a15d3 72 minutes ago\r\n* aebf2e0 85 minutes ago  (origin/develop, develop)\r\n* d6a4946 85 minutes ago\r\n* 90e8ac7 2 hours ago\r\n* 3213092 2 hours ago  (tag: 4.8.2, origin/master)\r\n* f4f7224 3 hours ago\r\n* 9dcd702 2 days ago\r\n* c40e2db 2 days ago  (tag: 4.8.1, master)\r\n* cd90e31 2 days ago\r\n* 69faea4 2 days ago\r\n* 14b5ac2 2 days ago\r\n* c0c5d38 2 days ago  (tag: 4.7.4)\r\n* d3ea3f7 2 days ago\r\n* 24f0e0c 5 days ago\r\n* a255288 5 days ago\r\n* 02b85c7 5 days ago\r\n* 744ff9c 5 days ago\r\n* 297d0e3 5 days ago\r\n* a1a54a1 5 days ago  (tag: 4.7.3)\r\n* 0fe510d 5 days ago\r\n* 0ab79c0 6 days ago\r\n* 7615f34 6 days ago  (tag: 4.7.2)\r\n* 3988f59 6 days ago\r\n* 3b596fe 6 days ago\r\n* 17e19d8 6 days ago\r\n* 1e4afc7 7 days ago  (tag: 4.7.1)\r\n* c38cb9a 7 days ago\r\n* 024bd56 7 days ago\r\n* 990b449 7 days ago\r\n* 35ccbab 8 days ago\r\n* 9c54837 13 days ago\r\n* 7bf8cde 13 days ago  (tag: 4.6.10)\r\n* 0325d78 13 days ago\r\n* 7c2423c 13 days ago\r\n*   f551cf4 13 days ago\r\n|\\\r\n| *   dfb354b 3 weeks ago  (tag: 4.6.9)\r\n| |\\\r\n| * | 008e3d7 3 weeks ago\r\n| * | e8b5a28 3 weeks ago\r\n| * | 154bb10 3 weeks ago\r\n* | | ed25239 2 weeks ago\r\n* | | 695b618 2 weeks ago\r\n* | | 2be6cc3 2 weeks ago\r\n* | | 47d877d 2 weeks ago\r\n* | | 54fcb32 2 weeks ago\r\n* | | 0d0d60e 2 weeks ago\r\n* | | 87d7337 3 weeks ago\r\n* | | 9085d68 3 weeks ago\r\n* | | 4c2e352 3 weeks ago\r\n* | | a98d758 3 weeks ago\r\n* | | b4ee9b8 3 weeks ago\r\n* | | efbb84c 3 weeks ago\r\n| |/\r\n|/|\r\n* | 0d106a8 3 weeks ago\r\n* | 914df4e 3 weeks ago\r\n* | 02ec44d 3 weeks ago\r\n* | 62b1424 3 weeks ago\r\n* | 4475a4b 3 weeks ago\r\n* | 19ebc8e 3 weeks ago\r\n|/\r\n* 2520efd 3 weeks ago  (tag: 4.6.8)\r\n* 1d6f779 3 weeks ago\r\n* ea288fe 3 weeks ago\r\n* e01583c 3 weeks ago\r\n* f2cc771 3 weeks ago\r\n* 4f6d7da 3 weeks ago\r\n* 08288c1 4 weeks ago\r\n* 31f9878 4 weeks ago  (tag: 4.6.7)\r\n* 5281588 4 weeks ago\r\n* 0084b80 4 weeks ago\r\n* a27a9d7 4 weeks ago\r\n* 1b92c76 4 weeks ago\r\n* 7d3ebd4 5 weeks ago\r\n* 81f09ad 5 weeks ago  (tag: 4.6.6)\r\n* 829998c 5 weeks ago\r\n* 4919037 5 weeks ago\r\n* 9e26f24 5 weeks ago  (tag: 4.6.5)\r\n* b030318 5 weeks ago\r\n* c02933a 5 weeks ago\r\n* f532f3b 5 weeks ago  (tag: 4.6.4)\r\n* f127142 5 weeks ago\r\n* eaf6473 5 weeks ago\r\n* bf401d4 5 weeks ago  (tag: 4.6.3)\r\n* 18cd554 5 weeks ago\r\n* 5e0b34e 5 weeks ago\r\n* 6ebb577 5 weeks ago  (tag: 4.6.2)\r\n* 8563acf 5 weeks ago\r\n* d47642e 5 weeks ago\r\n* 0c02169 5 weeks ago\r\n* 014c539 5 weeks ago\r\n* a98b610 5 weeks ago\r\n* b20e0ff 5 weeks ago\r\n* b5012f4 5 weeks ago\r\n* d23a18d 5 weeks ago\r\n* 94a9d49 5 weeks ago\r\n* 61714e8 5 weeks ago\r\n* 5dd47b2 6 weeks ago\r\n* 25d1e91 6 weeks ago\r\n* 463c885 6 weeks ago  (tag: 4.6.1)\r\n* 5680a8a 6 weeks ago\r\n* 06e3fa4 6 weeks ago\r\n* 0764c21 6 weeks ago\r\n```\r\n\r\nWhat may be causing this? This is a large and old repository and I doubt I'll be able to reproduce a simple test case. GitVersion has never been run in this project before; I'm planning on adding GitVersionTask to it, which is why I wanted to see how `gitversion.exe` was handling the repository first."},"comment":{"url":"https://api.github.com/repos/GitTools/GitVersion/issues/comments/146203348","html_url":"https://github.com/GitTools/GitVersion/issues/674#issuecomment-146203348","issue_url":"https://api.github.com/repos/GitTools/GitVersion/issues/674","id":146203348,"user":{"login":"orjan","id":124032,"avatar_url":"https://avatars.githubusercontent.com/u/124032?v=3","gravatar_id":"","url":"https://api.github.com/users/orjan","html_url":"https://github.com/orjan","followers_url":"https://api.github.com/users/orjan/followers","following_url":"https://api.github.com/users/orjan/following{/other_user}","gists_url":"https://api.github.com/users/orjan/gists{/gist_id}","starred_url":"https://api.github.com/users/orjan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/orjan/subscriptions","organizations_url":"https://api.github.com/users/orjan/orgs","repos_url":"https://api.github.com/users/orjan/repos","events_url":"https://api.github.com/users/orjan/events{/privacy}","received_events_url":"https://api.github.com/users/orjan/received_events","type":"User","site_admin":false},"created_at":"2015-10-07T13:58:10Z","updated_at":"2015-10-07T13:58:10Z","body":"Do you mind running gv in debug mode and provide a stacktrace with line numbers?\n\n/Örjan \n\n> On 07 Oct 2015, at 15:46, Asbjørn Ulsberg <notifications@github.com> wrote:\n> \n> When running gitversion.exe in a repository, it crashes with the following output:\n> \n> INFO [10/07/15 15:40:31:88] Working directory: C:\\Redacted\n> INFO [10/07/15 15:40:31:91] Project root is: C:\\Redacted\n> INFO [10/07/15 15:40:31:96] Using latest commit on specified branch\n> INFO [10/07/15 15:40:31:96] Begin: Attempting to inherit branch configuration from parent branch\n>   INFO [10/07/15 15:40:31:98] Begin: Finding branch source\n>   INFO [10/07/15 15:40:32:02] End: Finding branch source (Took: 40.94ms)\n> INFO [10/07/15 15:40:32:02] End: Attempting to inherit branch configuration from parent branch (Took\n> : 56.89ms)\n> ERROR [10/07/15 15:40:32:02] An unexpected error occurred:\n> System.NullReferenceException: Object reference not set to an instance of an object.\n>    at GitVersion.LibGitExtensions.<>c__DisplayClass3_0.<FindCommitBranchWasBranchedFrom>b__1(Branchb)\n>    at System.Linq.Enumerable.WhereSelectListIterator`2.MoveNext()\n>    at System.Linq.Enumerable.WhereEnumerableIterator`1.MoveNext()\n>    at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)\n>    at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)\n>    at GitVersion.LibGitExtensions.FindCommitBranchWasBranchedFrom(Branch branch, IRepository repository, Branch[] excludedBranches)\n>    at GitVersion.BranchConfigurationCalculator.InheritBranchConfiguration(Boolean onlyEvaluateTrackedBranches, IRepository repository, Commit currentCommit, Branch currentBranch, KeyValuePair`2 keyValuePair, BranchConfig branchConfiguration, Config config, IList`1 excludedInheritBranches)\n>    at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch, IList`1 excludedInheritBranches)\n>    at GitVersion.GitVersionContext.CalculateEffectiveConfiguration()\n>    at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId)\n>    at GitVersion.GitVersionContext..ctor(IRepository repository, Config configuration, Boolean isForTrackingBranchOnly, String commitId)\n>    at GitVersion.ExecuteCore.ExecuteGitVersion(IFileSystem fileSystem, String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId)\n>    at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)\n>    at GitVersion.Program.VerifyArgumentsAndRun()\n> INFO [10/07/15 15:40:32:02]\n> INFO [10/07/15 15:40:32:02] Here is the current git graph (please include in issue):\n> INFO [10/07/15 15:40:32:02] Showing max of 100 commits\n> INFO [10/07/15 15:40:32:12] * a461a04 51 minutes ago  (HEAD -> feature/gitversion)\n> * 37a15d3 72 minutes ago\n> * aebf2e0 85 minutes ago  (origin/develop, develop)\n> * d6a4946 85 minutes ago\n> * 90e8ac7 2 hours ago\n> * 3213092 2 hours ago  (tag: 4.8.2, origin/master)\n> * f4f7224 3 hours ago\n> * 9dcd702 2 days ago\n> * c40e2db 2 days ago  (tag: 4.8.1, master)\n> * cd90e31 2 days ago\n> * 69faea4 2 days ago\n> * 14b5ac2 2 days ago\n> * c0c5d38 2 days ago  (tag: 4.7.4)\n> * d3ea3f7 2 days ago\n> * 24f0e0c 5 days ago\n> * a255288 5 days ago\n> * 02b85c7 5 days ago\n> * 744ff9c 5 days ago\n> * 297d0e3 5 days ago\n> * a1a54a1 5 days ago  (tag: 4.7.3)\n> * 0fe510d 5 days ago\n> * 0ab79c0 6 days ago\n> * 7615f34 6 days ago  (tag: 4.7.2)\n> * 3988f59 6 days ago\n> * 3b596fe 6 days ago\n> * 17e19d8 6 days ago\n> * 1e4afc7 7 days ago  (tag: 4.7.1)\n> * c38cb9a 7 days ago\n> * 024bd56 7 days ago\n> * 990b449 7 days ago\n> * 35ccbab 8 days ago\n> * 9c54837 13 days ago\n> * 7bf8cde 13 days ago  (tag: 4.6.10)\n> * 0325d78 13 days ago\n> * 7c2423c 13 days ago\n> *   f551cf4 13 days ago\n> |\\\n> | *   dfb354b 3 weeks ago  (tag: 4.6.9)\n> | |\\\n> | * | 008e3d7 3 weeks ago\n> | * | e8b5a28 3 weeks ago\n> | * | 154bb10 3 weeks ago\n> * | | ed25239 2 weeks ago\n> * | | 695b618 2 weeks ago\n> * | | 2be6cc3 2 weeks ago\n> * | | 47d877d 2 weeks ago\n> * | | 54fcb32 2 weeks ago\n> * | | 0d0d60e 2 weeks ago\n> * | | 87d7337 3 weeks ago\n> * | | 9085d68 3 weeks ago\n> * | | 4c2e352 3 weeks ago\n> * | | a98d758 3 weeks ago\n> * | | b4ee9b8 3 weeks ago\n> * | | efbb84c 3 weeks ago\n> | |/\n> |/|\n> * | 0d106a8 3 weeks ago\n> * | 914df4e 3 weeks ago\n> * | 02ec44d 3 weeks ago\n> * | 62b1424 3 weeks ago\n> * | 4475a4b 3 weeks ago\n> * | 19ebc8e 3 weeks ago\n> |/\n> * 2520efd 3 weeks ago  (tag: 4.6.8)\n> * 1d6f779 3 weeks ago\n> * ea288fe 3 weeks ago\n> * e01583c 3 weeks ago\n> * f2cc771 3 weeks ago\n> * 4f6d7da 3 weeks ago\n> * 08288c1 4 weeks ago\n> * 31f9878 4 weeks ago  (tag: 4.6.7)\n> * 5281588 4 weeks ago\n> * 0084b80 4 weeks ago\n> * a27a9d7 4 weeks ago\n> * 1b92c76 4 weeks ago\n> * 7d3ebd4 5 weeks ago\n> * 81f09ad 5 weeks ago  (tag: 4.6.6)\n> * 829998c 5 weeks ago\n> * 4919037 5 weeks ago\n> * 9e26f24 5 weeks ago  (tag: 4.6.5)\n> * b030318 5 weeks ago\n> * c02933a 5 weeks ago\n> * f532f3b 5 weeks ago  (tag: 4.6.4)\n> * f127142 5 weeks ago\n> * eaf6473 5 weeks ago\n> * bf401d4 5 weeks ago  (tag: 4.6.3)\n> * 18cd554 5 weeks ago\n> * 5e0b34e 5 weeks ago\n> * 6ebb577 5 weeks ago  (tag: 4.6.2)\n> * 8563acf 5 weeks ago\n> * d47642e 5 weeks ago\n> * 0c02169 5 weeks ago\n> * 014c539 5 weeks ago\n> * a98b610 5 weeks ago\n> * b20e0ff 5 weeks ago\n> * b5012f4 5 weeks ago\n> * d23a18d 5 weeks ago\n> * 94a9d49 5 weeks ago\n> * 61714e8 5 weeks ago\n> * 5dd47b2 6 weeks ago\n> * 25d1e91 6 weeks ago\n> * 463c885 6 weeks ago  (tag: 4.6.1)\n> * 5680a8a 6 weeks ago\n> * 06e3fa4 6 weeks ago\n> * 0764c21 6 weeks ago\n> What may be causing this? This is a large and old repository and I doubt I'll be able to reproduce a simple test case. GitVersion has never been run in this project before; I'm planning on adding GitVersionTask to it, which is why I wanted to see how gitversion.exe was handling the repository first.\n> \n> —\n> Reply to this email directly or view it on GitHub.\n> \n"}}