Skip to content
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

ArgumentException on startup #6442

Closed
mstv opened this issue Apr 5, 2019 · 3 comments
Closed

ArgumentException on startup #6442

mstv opened this issue Apr 5, 2019 · 3 comments
Milestone

Comments

@mstv
Copy link
Member

mstv commented Apr 5, 2019

Current behaviour

Start GE, opens the last repo (GE) automatically --> AE "duplicate key in dictionary".

Expected behaviour

no crash

Screenshots

exception

Did this work in previous version of GitExtensions

yes

Environment

  • Git Extensions 3.1.0
  • Build 259c501
  • Git 2.20.1.windows.1
  • Microsoft Windows NT 6.1.7601 Service Pack 1
  • .NET Framework 4.7.2117.0
  • DPI 96dpi (no scaling)

Diagnostics

   at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
   at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
   at GitUI.CommitInfo.CommitInfo.<LoadSortedRefsAsync>g__ToDictionary|53_0(IReadOnlyList`1 list) in F:\Build\gitextensions\GitUI\CommitInfo\CommitInfo.cs:line 218
   at GitUI.CommitInfo.CommitInfo.<LoadSortedRefsAsync>d__53.MoveNext() in F:\Build\gitextensions\GitUI\CommitInfo\CommitInfo.cs:line 208
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.CommitInfo.CommitInfo.<<RefreshSortedRefs>b__47_0>d.MoveNext() in F:\Build\gitextensions\GitUI\CommitInfo\CommitInfo.cs:line 147
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at GitUI.ThreadHelper.<>c__DisplayClass13_0.<<FileAndForget>b__0>d.MoveNext() in F:\Build\gitextensions\GitExtUtils\GitUI\ThreadHelper.cs:line 101
@RussKie
Copy link
Member

RussKie commented Apr 7, 2019

It looks like there is a duplicate returned by the following call:

public IReadOnlyList<string> GetSortedRefs()
{
var args = new GitArgumentBuilder("for-each-ref")
{
"--sort=-committerdate",
"--sort=-taggerdate",
"--format=\"%(refname)\"",
"refs/"
};

Could you share what you get running the command?

@mstv
Copy link
Member Author

mstv commented Apr 7, 2019

Unfortunately, Git does not indicate my broken repo with an non-zero the exit code.

$ git for-each-ref --sort=-committerdate --sort=-taggerdate --format="%(refname)" refs/
warning: ignoring broken ref refs/remotes/upstream/HEAD
warning: ignoring broken ref refs/remotes/upstream/master
refs/tags/v3.0.2
refs/tags/v3.0.1
...

@mstv
Copy link
Member Author

mstv commented Apr 7, 2019

The file gitextensions\.git\refs\remotes\upstream\master contained 41 null bytes.

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

No branches or pull requests

2 participants