Skip to content

Sequence contains more than one matching element #453

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
richardwadsworth opened this issue May 29, 2015 · 7 comments
Closed

Sequence contains more than one matching element #453

richardwadsworth opened this issue May 29, 2015 · 7 comments

Comments

@richardwadsworth
Copy link

I am getting this error from TeamCity running "GitVersion 3.0.0-beta0002":

HEAD is detached and points at commit 'ace660f968753ea2e455fecfdce799a17db12bf4'.
No local branch pointing at the commit 'ace660f968753ea2e455fecfdce799a17db12bf4'. Fake branch needs to be created.
Found remote tip 'refs/pull/5/merge' pointing at the commit 'ace660f968753ea2e455fecfdce799a17db12bf4'.
Creating fake local branch 'refs/heads/pull/5/merge'.
Checking local branch 'refs/heads/pull/5/merge' out.
No specific commit specified or found, falling back to latest commit on specified branch
Attempting to inherit branch configuration from parent branch
An unexpected error occurred:
System.InvalidOperationException: Sequence contains more than one matching element
   at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable`1 source, Func`2 predicate)
   at GitVersion.BranchConfigurationCalculator.InheritBranchConfiguration(Boolean onlyEvaluateTrackedBranches, IRepository repository, Commit currentCommit, Branch currentBranch, KeyValuePair`2 keyValuePair, BranchConfig branchConfiguration, Config config) in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\BranchConfigurationCalculator.cs:line 60
   at GitVersion.BranchConfigurationCalculator.GetBranchConfiguration(Commit currentCommit, IRepository repository, Boolean onlyEvaluateTrackedBranches, Config config, Branch currentBranch) in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\BranchConfigurationCalculator.cs:line 26
   at GitVersion.GitVersionContext.CalculateEffectiveConfiguration() in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\GitVersionContext.cs:line 79
   at GitVersion.GitVersionContext..ctor(IRepository repository, Branch currentBranch, Config configuration, Boolean onlyEvaluateTrackedBranches, String commitId) in c:\BuildAgent\work\5106452ed7682238\GitVersionCore\GitVersionContext.cs:line 57
   at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
   at GitVersion.Program.VerifyArgumentsAndRun()

I created branch, committed and pushed, created a pull request against a branch and then committed an additional change to that branch.

GitVersion parses the original commit (2.0.1-abc.1+1), the first PR (2.0.1-PullRequest.5+2) and the second commit (2.0.1-abc.1+2) but throws the above exception when parsing the PR. There are 3 tags against the repo.

@JakeGinnivan
Copy link
Contributor

Are you able to check if master has the same issue? There are a few fixes to still go in around this particular class, but there have been a few already

@richardwadsworth
Copy link
Author

master builds without the same issue.

@JakeGinnivan
Copy link
Contributor

Great. I am working on getting beta3 out over the weekend. Will let you know once out

@richardwadsworth
Copy link
Author

perfect thanks. Interestingly, I've just forced the build on that same PR (after making some other unrelated commits and merges) and it's built ok with a build number of 2.0.2-PullRequest.5+3. Note the patch has incremented.

@JakeGinnivan
Copy link
Contributor

I think that is the same as this: #415

@JakeGinnivan
Copy link
Contributor

Pretty sure this is fixed

@JakeGinnivan
Copy link
Contributor

In master that is, next release should not have the PR version issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants