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

Remove IRunScript and replace usage with IScriptHostControl #11321

Open
wants to merge 7 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions GitUI/CommandsDialogs/FormBrowse.cs
Original file line number Diff line number Diff line change
Expand Up @@ -315,7 +315,7 @@ internal FormBrowse(GitUICommands commands, BrowseArguments args, ISettingsSourc

_aheadBehindDataProvider = new AheadBehindDataProvider(() => Module.GitExecutable);
toolStripButtonPush.Initialize(_aheadBehindDataProvider);
repoObjectsTree.Initialize(_aheadBehindDataProvider, filterRevisionGridBySpaceSeparatedRefs: ToolStripFilters.SetBranchFilter, refsSource: RevisionGrid, revisionGridInfo: RevisionGrid, scriptRunner: RevisionGrid);
repoObjectsTree.Initialize(_aheadBehindDataProvider, filterRevisionGridBySpaceSeparatedRefs: ToolStripFilters.SetBranchFilter, refsSource: RevisionGrid, revisionGridInfo: RevisionGrid, scriptHostControl: RevisionGrid);
revisionDiff.Bind(revisionGridInfo: RevisionGrid, revisionGridUpdate: RevisionGrid, revisionFileTree: fileTree, () => RevisionGrid.CurrentFilter.PathFilter, RefreshGitStatusMonitor);

// Show blame by default if not started from command line
Expand Down Expand Up @@ -1013,7 +1013,7 @@ void LoadUserMenu()
DisplayStyle = ToolStripItemDisplayStyle.ImageAndText
};

button.Click += (s, e) => ScriptsRunner.RunScript(script.HotkeyCommandIdentifier, this, RevisionGrid);
button.Click += (s, e) => ScriptsRunner.RunScript(script.HotkeyCommandIdentifier, RevisionGrid);

// add to toolstrip
ToolStripScripts.Items.Add(button);
Expand Down
13 changes: 7 additions & 6 deletions GitUI/CommandsDialogs/UserScriptContextMenuExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,21 +15,21 @@ public static class UserScriptContextMenuExtensions
/// </summary>
/// <param name="contextMenu">The context menu to add user scripts to.</param>
/// <param name="hostMenuItem">The menu item user scripts not marked as <see cref="ScriptInfo.AddToRevisionGridContextMenu"/> are added to.</param>
/// <param name="scriptInvoker">The handler that handles user script invocation.</param>
public static void AddUserScripts(this ContextMenuStrip contextMenu, ToolStripMenuItem hostMenuItem, Action<int> scriptInvoker, IServiceProvider serviceProvider)
/// <param name="scriptHostControl">UI control that provides parameters to the script, and may receive refresh and navigation events from it.</param>
public static void AddUserScripts(this ContextMenuStrip contextMenu, ToolStripMenuItem hostMenuItem, IScriptHostControl scriptHostControl)
{
ArgumentNullException.ThrowIfNull(contextMenu);
ArgumentNullException.ThrowIfNull(hostMenuItem);
ArgumentNullException.ThrowIfNull(scriptInvoker);
ArgumentNullException.ThrowIfNull(scriptHostControl);

RemoveOwnScripts(contextMenu, hostMenuItem);
int hostItemIndex = contextMenu.Items.IndexOf(hostMenuItem);
int lastScriptItemIndex = hostItemIndex;

IScriptsManager scriptsManager = serviceProvider.GetRequiredService<IScriptsManager>();
IScriptsManager scriptsManager = scriptHostControl.UICommands.GetRequiredService<IScriptsManager>();
IEnumerable<ScriptInfo> scripts = scriptsManager.GetScripts().Where(x => x.Enabled);

IHotkeySettingsLoader hotkeySettingsLoader = serviceProvider.GetRequiredService<IHotkeySettingsLoader>();
IHotkeySettingsLoader hotkeySettingsLoader = scriptHostControl.UICommands.GetRequiredService<IHotkeySettingsLoader>();
IReadOnlyList<HotkeyCommand> hotkeys = hotkeySettingsLoader.LoadHotkeys(FormSettings.HotkeySettingsName);

foreach (ScriptInfo script in scripts)
Expand All @@ -45,7 +45,8 @@ public static void AddUserScripts(this ContextMenuStrip contextMenu, ToolStripMe
item.Click += (s, e) =>
{
int scriptId = script.HotkeyCommandIdentifier;
scriptInvoker(scriptId);
IScriptsRunner scriptsRunner = scriptHostControl.UICommands.GetRequiredService<IScriptsRunner>();
scriptsRunner.RunScript(scriptId, scriptHostControl);
};

if (script.AddToRevisionGridContextMenu)
Expand Down
20 changes: 16 additions & 4 deletions GitUI/GitModuleControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -132,14 +132,26 @@ protected override bool ExecuteCommand(int command)

bool ExecuteScriptCommand()
{
RevisionGridControl revisionGridControl = this as RevisionGridControl;
if (revisionGridControl is null)
IScriptHostControl? scriptHostControl = null;
for (Control control = this; control is not null; control = control.Parent)
{
revisionGridControl = (FindForm() as GitModuleForm)?.RevisionGridControl;
scriptHostControl = control as IScriptHostControl;
if (scriptHostControl is not null)
{
break;
}

if (control is GitModuleForm gitModuleForm)
{
scriptHostControl = gitModuleForm.RevisionGridControl;
break;
}
}

scriptHostControl ??= new DefaultScriptHostControl(FindForm(), UICommands);

IScriptsRunner scriptsRunner = UICommands.GetRequiredService<IScriptsRunner>();
return scriptsRunner.RunScript(command, FindForm() as GitModuleForm, revisionGridControl);
return scriptsRunner.RunScript(command, scriptHostControl);
}
}

Expand Down
2 changes: 1 addition & 1 deletion GitUI/GitModuleForm.cs
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ protected GitModuleForm([NotNull] GitUICommands commands)

protected override bool ExecuteCommand(int command)
{
return ScriptsRunner.RunScript(command, this, RevisionGridControl)
return ScriptsRunner.RunScript(command, (this as IScriptHostControl) ?? ((IScriptHostControl?)RevisionGridControl) ?? new DefaultScriptHostControl(this, UICommands))
|| base.ExecuteCommand(command);
}

Expand Down
2 changes: 1 addition & 1 deletion GitUI/LeftPanel/RepoObjectsTree.ContextActions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ private void contextMenu_Opening(object sender, CancelEventArgs e)

if (hasSingleSelection && selectedLocalBranch?.Visible == true)
{
contextMenu.AddUserScripts(runScriptToolStripMenuItem, _scriptRunner.Execute, UICommands);
contextMenu.AddUserScripts(runScriptToolStripMenuItem, _scriptHostControl);
}
else
{
Expand Down
6 changes: 3 additions & 3 deletions GitUI/LeftPanel/RepoObjectsTree.cs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ public sealed partial class RepoObjectsTree : GitModuleControl
private bool _searchCriteriaChanged;
private ICheckRefs _refsSource;
private IRevisionGridInfo _revisionGridInfo;
private IRunScript _scriptRunner;
private IScriptHostControl _scriptHostControl;

public RepoObjectsTree()
{
Expand Down Expand Up @@ -221,13 +221,13 @@ bool IsOverride(MethodInfo m)
}

public void Initialize(IAheadBehindDataProvider? aheadBehindDataProvider, Action<string?> filterRevisionGridBySpaceSeparatedRefs,
ICheckRefs refsSource, IRevisionGridInfo revisionGridInfo, IRunScript scriptRunner)
ICheckRefs refsSource, IRevisionGridInfo revisionGridInfo, IScriptHostControl scriptHostControl)
{
_aheadBehindDataProvider = aheadBehindDataProvider;
_filterRevisionGridBySpaceSeparatedRefs = filterRevisionGridBySpaceSeparatedRefs;
_refsSource = refsSource;
_revisionGridInfo = revisionGridInfo;
_scriptRunner = scriptRunner;
_scriptHostControl = scriptHostControl;

// This lazily sets the command source, invoking OnUICommandsSourceSet, which is required for setting up
// notifications for each Tree.
Expand Down
8 changes: 0 additions & 8 deletions GitUI/ScriptsEngine/IRunScript.cs

This file was deleted.

29 changes: 29 additions & 0 deletions GitUI/ScriptsEngine/IScriptHostControl.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,34 @@ public interface IScriptHostControl
GitRevision? GetLatestSelectedRevision();
IReadOnlyList<GitRevision> GetSelectedRevisions();
Point GetQuickItemSelectorLocation();

void GoToRef(string? refName, bool showNoRevisionMsg, bool toggleSelection = false);

bool IsRevisionGrid { get; }
IWin32Window Window { get; }
IGitUICommands UICommands { get; }
Comment on lines 7 to +15
Copy link
Member

Choose a reason for hiding this comment

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

The not Control-specific functions of IScriptHostControl should be removed and be called via the anyway mandatory IGitUICommands and a slightly extended IBrowseRepo.

    public sealed class GitUICommands : IGitUICommands
        public IBrowseRepo? BrowseRepo { get; set; }

    public interface IBrowseRepo
    {
        void GoToRef(string refName, bool showNoRevisionMsg, bool toggleSelection = false);
        void SetWorkingDir(string? path, ObjectId? selectedId = null, ObjectId? firstId = null);
        IReadOnlyList<GitRevision> GetSelectedRevisions();
    }

Then there will be no need for IScriptHostControl at all because the pair (IGitUICommands, IWin32Window) suffices - or THostForm : IGitModuleForm, IWin32Window.

initial discussion: #11273 (comment)

Thoughts, @RussKie?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

A pair would never suffice, by virtue of being a pair. Because it has to be passed to, and stored inside, the likes of RepoObjectsTree. And there are no intersection types in C#. That's how we went down this rabbit hole in the first place.

The other aspect is adding file selection methods to IScriptHostControl, which is necessary for #11239. So even if it was possible to remove IScriptHostControl, it would only create issues down the line.

And no, replacing it with IGitUICommands is not an option, because of windows like FormCommit that have multiple file lists in them. Having a relatively small, easily extensible interface, allows implementing a different file list for each control within the window. It allows returning the form's common UICommands, while still having customized file lists.

TL;DR IScriptHostControl has to correspond with a control, not a form. Therefore, a form-common (and certainly an app-common) interface is too large to act as a replacement.

Copy link
Member

@mstv mstv Nov 4, 2023

Choose a reason for hiding this comment

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

You are right that file selection methods should be added to IScriptHostControl.
So I found a rationale why the current IScriptHostControl functions should be moved to IBrowseRepo (#11324): File scripts may benefit from RevisionGrid information, too. Having either files or revisions would be an arbitrary restriction.

Regarding RepoObjectsTree and RevisionGridControl, everything necessary is provided via IGitUICommands. They share the same owner Form.
IScriptHostControl can remain empty in this PR.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

IScriptHostControl can already carry both files and revisions if both information is available (e.g. diff view). And can skip the latter when it's unavailable (e.g. commit form). Moving half of that info to IBrowseRepo doesn't make sense, when IBrowseRepo cannot conceivably handle the other half.

You're right that if everything is provided via THostForm, then RepoObjectsTree can simply use FindForm() as GitModuleForm (which, technically, is already a double-hack, using as, as well as using GitModuleForm in place of an intersection type). But the same would not apply to file lists, which would lack the ability to provide per-list overrides this way.

Ultimately, instead of a clean-up refactor, it's a refactor that just makes everything more convoluted and complex. The beauty of IScriptHostControl is that it's relatively tiny, and can easily be extended/proxied with relatively minimal effort. More importantly, it's single-purpose. It's used purely for being passed to RunScript. RunScript does not need to worry about getting other parameters, and IScriptHostControl does not need to worry about having other responsibilities.

Copy link
Member

Choose a reason for hiding this comment

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

Then there will be no need for IScriptHostControl at all because the pair (IGitUICommands, IWin32Window) suffices

This was an unlucky wording. Rather read "the pair" as "the two". And "no need for IScriptHostControl" means for this PR "Removal IRunScript".

IWin32Window is just needed as window owner of selection popups. Every control which wants to execute scripts, can pass its own handle (or its Form's handle).
Every control which operates on a repo, already has an IGitUICommands instance.
There is no need to downcast to GitModuleForm.
THostForm was just a trick in order to pass an owner handle and the IGitUICommands instance in one argument. This can and should be split again.

FileStatusList does not need to have information about e.g. the current checkout - and shall not need to have, which would be necessary if IScriptHostControl would provide information about revisions and files.
Such information about revisions is provided by IBrowseRepo.
What remains? A control wants to provide an interface in order to support additional placeholders ("options") in script arguments.
In the next PR, these will be files - in the future, something different for another control perhaps.
Hence it is nothing other than IAdditionalScriptOptionsParser or IScriptOptionsProvider (and not a "host control").
(Choosing names is not my strength. I am open to proposals.)
IScriptHostControl should not be touched nor used by this PR - after rebase on #11324.
Alternatively, we could supersede this PR with a new one. You or me?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I'm not entirely sure where you're going with this, so definitely you. If it gets accepted, I'll rebase #11239 on it, in the way that makes the most sense given the revised design.

}

public class DefaultScriptHostControl : IScriptHostControl
{
public DefaultScriptHostControl(IWin32Window window, IGitUICommands uiCommands)
{
Window = window;
UICommands = uiCommands;
}

public GitRevision? GetLatestSelectedRevision() => throw new NotImplementedException();

public IReadOnlyList<GitRevision> GetSelectedRevisions() => throw new NotImplementedException();

public Point GetQuickItemSelectorLocation() => new Point();

public void GoToRef(string? refName, bool showNoRevisionMsg, bool toggleSelection = false) => throw new NotImplementedException();

public bool IsRevisionGrid => false;

public IWin32Window Window { get; }

public IGitUICommands UICommands { get; }
}
}
3 changes: 1 addition & 2 deletions GitUI/ScriptsEngine/IScriptsRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ public interface IScriptsRunner
bool RunEventScripts<THostForm>(ScriptEvent scriptEvent, THostForm form)
where THostForm : IGitModuleForm, IWin32Window;

bool RunScript<THostForm>(int scriptId, THostForm form, RevisionGridControl? revisionGrid = null)
where THostForm : IGitModuleForm, IWin32Window;
bool RunScript(int scriptId, IScriptHostControl scriptHostControl);
}
}
22 changes: 11 additions & 11 deletions GitUI/ScriptsEngine/ScriptOptionsParser.cs
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ public static bool DependsOnSelectedRevision(string option)
return option.StartsWith("s");
}

public static (string? arguments, bool abort) Parse(string? arguments, IGitUICommands uiCommands, IWin32Window owner, IScriptHostControl? scriptHostControl)
public static (string? arguments, bool abort) Parse(string? arguments, IGitUICommands uiCommands, IWin32Window owner, IScriptHostControl scriptHostControl)
{
if (string.IsNullOrWhiteSpace(arguments))
{
Expand Down Expand Up @@ -136,7 +136,7 @@ public static (string? arguments, bool abort) Parse(string? arguments, IGitUICom
}
}
}
else if (selectedRevision is null && scriptHostControl is not null && DependsOnSelectedRevision(option))
else if (selectedRevision is null && scriptHostControl.IsRevisionGrid && DependsOnSelectedRevision(option))
{
allSelectedRevisions = scriptHostControl.GetSelectedRevisions() ?? Array.Empty<GitRevision>();
selectedRevision = CalculateSelectedRevision(scriptHostControl, selectedRemoteBranches, selectedRemotes, selectedLocalBranches, selectedBranches, selectedTags);
Expand All @@ -156,7 +156,7 @@ public static (string? arguments, bool abort) Parse(string? arguments, IGitUICom
return (arguments, abort: false);
}

private static string AskToSpecify(IEnumerable<IGitRef> options, IScriptHostControl? scriptHostControl)
private static string AskToSpecify(IEnumerable<IGitRef> options, IScriptHostControl scriptHostControl)
{
List<IGitRef> items = options.ToList();
if (items.Count == 0)
Expand All @@ -165,26 +165,26 @@ private static string AskToSpecify(IEnumerable<IGitRef> options, IScriptHostCont
}

using FormQuickGitRefSelector f = new();
f.Location = scriptHostControl?.GetQuickItemSelectorLocation() ?? new Point();
f.Location = scriptHostControl.GetQuickItemSelectorLocation();
f.Init(FormQuickGitRefSelector.Action.Select, items);
f.ShowDialog();
return f.SelectedRef?.Name ?? "";
}

private static string AskToSpecify(IEnumerable<string> options, IScriptHostControl? scriptHostControl)
private static string AskToSpecify(IEnumerable<string> options, IScriptHostControl scriptHostControl)
{
using FormQuickStringSelector f = new();
f.Location = scriptHostControl?.GetQuickItemSelectorLocation() ?? new Point();
f.Location = scriptHostControl.GetQuickItemSelectorLocation();
f.Init(options.ToList());
f.ShowDialog();
return f.SelectedString ?? "";
}

private static GitRevision? CalculateSelectedRevision(IScriptHostControl? scriptHostControl, List<IGitRef> selectedRemoteBranches,
private static GitRevision? CalculateSelectedRevision(IScriptHostControl scriptHostControl, List<IGitRef> selectedRemoteBranches,
List<string> selectedRemotes, List<IGitRef> selectedLocalBranches,
List<IGitRef> selectedBranches, List<IGitRef> selectedTags)
{
GitRevision? selectedRevision = scriptHostControl?.GetLatestSelectedRevision();
GitRevision? selectedRevision = scriptHostControl.GetLatestSelectedRevision();
if (selectedRevision is null)
{
return null;
Expand Down Expand Up @@ -278,7 +278,7 @@ private static string GetRemotePath(string url)
}

private static string? ParseScriptArguments(string arguments, string option, IWin32Window owner,
IScriptHostControl? scriptHostControl, IGitUICommands uiCommands, IReadOnlyList<GitRevision> allSelectedRevisions,
IScriptHostControl scriptHostControl, IGitUICommands uiCommands, IReadOnlyList<GitRevision> allSelectedRevisions,
in IList<IGitRef> selectedTags, in IList<IGitRef> selectedBranches, in IList<IGitRef> selectedLocalBranches,
in IList<IGitRef> selectedRemoteBranches, in IList<string> selectedRemotes, GitRevision selectedRevision,
in IList<IGitRef> currentTags, in IList<IGitRef> currentBranches, in IList<IGitRef> currentLocalBranches,
Expand Down Expand Up @@ -506,7 +506,7 @@ private static string GetRemotePath(string url)
string SelectOneString(IList<string> strings) => ScriptOptionsParser.SelectOne(strings, scriptHostControl);
}

private static string SelectOne(IList<IGitRef> refs, IScriptHostControl? scriptHostControl)
private static string SelectOne(IList<IGitRef> refs, IScriptHostControl scriptHostControl)
{
return refs.Count switch
{
Expand All @@ -516,7 +516,7 @@ private static string SelectOne(IList<IGitRef> refs, IScriptHostControl? scriptH
};
}

private static string SelectOne(IList<string> strings, IScriptHostControl? scriptHostControl)
private static string SelectOne(IList<string> strings, IScriptHostControl scriptHostControl)
{
return strings.Count switch
{
Expand Down
15 changes: 7 additions & 8 deletions GitUI/ScriptsEngine/ScriptsManager.ScriptRunner.cs
Original file line number Diff line number Diff line change
Expand Up @@ -16,28 +16,27 @@ internal static class ScriptRunner
private const string PluginPrefix = "plugin:";
private const string NavigateToPrefix = "navigateTo:";

public static bool RunScript<THostForm>(ScriptInfo script, THostForm form, RevisionGridControl? revisionGrid)
where THostForm : IGitModuleForm, IWin32Window
public static bool RunScript(ScriptInfo script, IScriptHostControl scriptHostControl)
{
try
{
return RunScriptInternal(script, form, form.UICommands, revisionGrid);
return RunScriptInternal(script, scriptHostControl.Window, scriptHostControl.UICommands, scriptHostControl);
}
catch (ExternalOperationException ex) when (ex is not UserExternalOperationException)
{
throw new UserExternalOperationException($"{TranslatedStrings.ScriptErrorFailedToExecute}: '{script.Name}'", ex);
}
}

private static bool RunScriptInternal(ScriptInfo script, IWin32Window owner, IGitUICommands uiCommands, RevisionGridControl? revisionGrid)
private static bool RunScriptInternal(ScriptInfo script, IWin32Window owner, IGitUICommands uiCommands, IScriptHostControl scriptHostControl)
{
if (string.IsNullOrEmpty(script.Command))
{
return false;
}

string? arguments = script.Arguments;
if (!string.IsNullOrEmpty(arguments) && revisionGrid is null)
if (!string.IsNullOrEmpty(arguments) && !scriptHostControl.IsRevisionGrid)
{
string? optionDependingOnSelectedRevision
= ScriptOptionsParser.Options.FirstOrDefault(option => ScriptOptionsParser.DependsOnSelectedRevision(option)
Expand All @@ -57,7 +56,7 @@ private static bool RunScriptInternal(ScriptInfo script, IWin32Window owner, IGi
}

string? originalCommand = script.Command;
(string? argument, bool abort) = ScriptOptionsParser.Parse(script.Arguments, uiCommands, owner, revisionGrid);
(string? argument, bool abort) = ScriptOptionsParser.Parse(script.Arguments, uiCommands, owner, scriptHostControl);
if (abort)
{
throw new UserExternalOperationException($"{TranslatedStrings.ScriptText}: '{script.Name}'{Environment.NewLine}{TranslatedStrings.ScriptErrorOptionWithoutRevisionText}",
Expand Down Expand Up @@ -102,7 +101,7 @@ private static bool RunScriptInternal(ScriptInfo script, IWin32Window owner, IGi

if (command.StartsWith(NavigateToPrefix))
{
if (revisionGrid is null)
if (!scriptHostControl.IsRevisionGrid)
{
return false;
}
Expand All @@ -115,7 +114,7 @@ private static bool RunScriptInternal(ScriptInfo script, IWin32Window owner, IGi

if (revisionRef is not null)
{
revisionGrid.GoToRef(revisionRef, true);
scriptHostControl.GoToRef(revisionRef, true);
}
}

Expand Down
9 changes: 4 additions & 5 deletions GitUI/ScriptsEngine/ScriptsManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ public bool RunEventScripts<THostForm>(ScriptEvent scriptEvent, THostForm form)
{
foreach (ScriptInfo script in GetScripts().Where(scriptInfo => scriptInfo.Enabled && scriptInfo.OnEvent == scriptEvent))
{
bool executed = ScriptRunner.RunScript(script, form, revisionGrid: null);
bool executed = ScriptRunner.RunScript(script, new DefaultScriptHostControl(form, form.UICommands));
if (!executed)
{
return false;
Expand All @@ -67,17 +67,16 @@ public bool RunEventScripts<THostForm>(ScriptEvent scriptEvent, THostForm form)
return true;
}

public bool RunScript<THostForm>(int scriptId, THostForm form, RevisionGridControl? revisionGrid = null)
where THostForm : IGitModuleForm, IWin32Window
public bool RunScript(int scriptId, IScriptHostControl scriptHostControl)
{
ScriptInfo? scriptInfo = GetScript(scriptId);
if (scriptInfo is null)
{
throw new UserExternalOperationException($"{TranslatedStrings.ScriptErrorCantFind}: '{scriptId}'",
new ExternalOperationException(workingDirectory: form.UICommands.GitModule.WorkingDir));
new ExternalOperationException(workingDirectory: scriptHostControl.UICommands.GitModule.WorkingDir));
}

return ScriptRunner.RunScript(scriptInfo, form, revisionGrid);
return ScriptRunner.RunScript(scriptInfo, scriptHostControl);
}

public string? SerializeIntoXml()
Expand Down
Loading
Loading