Skip to content

Conversation

RussKie
Copy link
Member

@RussKie RussKie commented Sep 18, 2024

Resolves #11906

Test methodology

  • manually

Test environment(s)

  • GIT
  • Windows

Merge strategy

I agree that the maintainer squash merge this PR (if the commit message is clear).


✒️ I contribute this code under The Developer Certificate of Origin.

@RussKie RussKie added this to the 5.0.1 milestone Sep 18, 2024
Copy link
Member

@pmiossec pmiossec left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

OK but I prefer a better naming because I'm a bit lost in namings

Copy link
Member

@mstv mstv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch!
(I wonder why most of us could not reproduce the exception.)

private readonly IRepositoryHostPlugin _gitHoster;
private readonly EventHandler<GitModuleEventArgs>? _gitModuleChanged;

public ForkAndCloneForm(IRepositoryHostPlugin gitHoster, EventHandler<GitModuleEventArgs>? gitModuleChanged)
public ForkAndCloneForm(IGitUICommands commands, IRepositoryHostPlugin gitHoster, EventHandler<GitModuleEventArgs>? gitModuleChanged)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
public ForkAndCloneForm(IGitUICommands commands, IRepositoryHostPlugin gitHoster, EventHandler<GitModuleEventArgs>? gitModuleChanged)
public ForkAndCloneForm(IServiceProvider serviceProvider, IRepositoryHostPlugin gitHoster, EventHandler<GitModuleEventArgs>? gitModuleChanged)

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We don't do this for the forms, only for controls. I haven't given this too much thought, but on the surface it's probably a good change to make across the codebase.

@@ -370,11 +372,9 @@ private void Clone(IHostedRepository repo)
return;
}

GitUICommands uiCommands = new(GitUICommands.EmptyServiceProvider, new GitModule(null));
ArgumentString cmd = Commands.Clone(repo.CloneUrl, targetDir, _commands.Module.GetPathForGitExecution, depth: GetDepth());
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
ArgumentString cmd = Commands.Clone(repo.CloneUrl, targetDir, _commands.Module.GetPathForGitExecution, depth: GetDepth());
GitUICommands uiCommands = new(_serviceProvider, new GitModule(null));

@@ -1302,7 +1302,7 @@ public void StartCloneForkFromHoster(IWin32Window? owner, IRepositoryHostPlugin
{
WrapRepoHostingCall(TranslatedStrings.ForkCloneRepo, gitHoster, gh =>
{
using ForkAndCloneForm frm = new(gh, gitModuleChanged);
using ForkAndCloneForm frm = new(this, gh, gitModuleChanged);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
using ForkAndCloneForm frm = new(this, gh, gitModuleChanged);
using ForkAndCloneForm frm = new(serviceProvider: this, gh, gitModuleChanged);

@pmiossec
Copy link
Member

(I wonder why most of us could not reproduce the exception.)

I was about (I worked on it and diagnosed the issue but I had to stop working on it and so was slower than @RussKie to propose the fix)

@RussKie RussKie merged commit ce44247 into gitextensions:master Sep 25, 2024
4 checks passed
@RussKie RussKie deleted the 11906 branch September 25, 2024 12:04
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

Successfully merging this pull request may close these issues.

[NBug] No service for type 'ResourceManager.IHotkeySettingsLoader'...
3 participants