Skip to content

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

@katrinaLidere

Description

@katrinaLidere

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

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions