Skip to content

Error after commit where Friendly name replaced with NameWithoutRemote() #1625

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
katrinaLidere opened this issue Mar 5, 2019 · 2 comments
Closed
Assignees
Labels

Comments

@katrinaLidere
Copy link

Hi!

I am quite sure what after 01.03.2019 commit 735a1dd

we started to receive error:

INFO [03/04/19 16:42:14:00] End: Loading version variables from disk cache (Took: 126.66ms)
INFO [03/04/19 16:42:14:00] IsDynamicGitRepository: False
INFO [03/04/19 16:42:14:00] Returning Project Root from DotGitDirectory: C:\Users\kl\source\repos\test2.git - C:\Users\kl\source\repos\test2
ERROR [03/04/19 16:42:14:10] An unexpected error occurred:
System.InvalidOperationException: Sequence contains more than one matching element
at System.Linq.Enumerable.SingleOrDefault[TSource](IEnumerable1 source, Func2 predicate)
at GitVersion.GitVersionContext.GetTargetBranch(IRepository repository, String targetBranch)
at GitVersion.ExecuteCore.<>c__DisplayClass6_0.b__0(IRepository repo)
at GitVersion.GitPreparer.WithRepository[TResult](Func`2 action)
at GitVersion.ExecuteCore.ExecuteGitVersion(String targetUrl, String dynamicRepositoryLocation, Authentication authentication, String targetBranch, Boolean noFetch, String workingDirectory, String commitId, Config overrideConfig, Boolean noCache)
at GitVersion.SpecifiedArgumentRunner.Run(Arguments arguments, IFileSystem fileSystem)
at GitVersion.Program.VerifyArgumentsAndRun()
INFO [03/04/19 16:42:14:13]
INFO [03/04/19 16:42:14:13] Attempting to show the current git graph (please include in issue):
INFO [03/04/19 16:42:14:13] Showing max of 100 commits

If I run in debug mode Gitversion I can see what repository object contains:
branch attributes: b.CanonicalName refs/heads/master, b.FriendlyName master, b.NameWithoutRemote master
and
branch attributes: b.CanonicalName refs/remotes/origin/master,b.FriendlyName origin/master, b.NameWithoutRemote master

by this SingleOrDefault throws error

@asbjornu
Copy link
Member

Nice find, @katrinaLidere. Thanks for reporting. Are you up for providing a pull request that fixes the problem introduced in #1613?

@stale
Copy link

stale bot commented Jun 29, 2019

This issue has been automatically marked as stale because it has not had recent activity. After 30 days from now, it will be closed if no further activity occurs. Thank you for your contributions.

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

No branches or pull requests

2 participants