Skip to content

Commit 5e95991

Browse files
authored
Merge pull request #45 from lekhmanrus/net48
Upgrade dependencies
2 parents 9d2b4e5 + d161321 commit 5e95991

20 files changed

+345
-310
lines changed

Directory.Build.props

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
<PackageVersion>0.0.0.1</PackageVersion>
1414
<PackageTags>GitExtensions</PackageTags>
1515
</PropertyGroup>
16-
16+
1717
<PropertyGroup>
1818
<TargetFramework>net461</TargetFramework>
1919
<VersionPrefix>1.0.0</VersionPrefix>

UnitTests/GitExtensions.GerritPlugin.Tests/GitExtensions.GerritPlugin.Tests.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<Project Sdk="Microsoft.NET.Sdk">
22
<ItemGroup>
3-
<PackageReference Include="NUnit" Version="3.12.0" />
3+
<PackageReference Include="NUnit" Version="3.13.2" />
44
</ItemGroup>
55

66
<ItemGroup>

UnitTests/GitExtensions.GerritPlugin.Tests/Server/CommandBuilderWithDraftSupportTests.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ public static string Build_with_all_values_on_default_builds_expected_command()
3535
{
3636
var sut = new CommandBuilderWithDraftSupport();
3737
return sut.WithReviewers(string.Empty)
38-
.WithCC(string.Empty)
38+
.WithCc(string.Empty)
3939
.WithTopic(string.Empty)
4040
.WithPublishType(string.Empty)
4141
.WithHashTag(string.Empty)
@@ -47,7 +47,7 @@ public static string Build_with_values_for_all_options_builds_expected_command()
4747
{
4848
var sut = new CommandBuilderWithDraftSupport();
4949
return sut.WithReviewers("mygroup")
50-
.WithCC("team2")
50+
.WithCc("team2")
5151
.WithTopic("ABC-123")
5252
.WithPublishType(string.Empty)
5353
.WithHashTag("what")

src/GitExtensions.GerritPlugin/FormGerritBase.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,8 +7,8 @@ namespace GitExtensions.GerritPlugin
77
public class FormGerritBase : GitExtensionsForm
88
{
99
protected GerritSettings Settings { get; private set; }
10-
protected readonly IGitUICommands UICommands;
11-
protected IGitModule Module => UICommands.GitModule;
10+
protected readonly IGitUICommands UiCommands;
11+
protected IGitModule Module => UiCommands.GitModule;
1212

1313
private FormGerritBase()
1414
: this(null)
@@ -18,7 +18,7 @@ private FormGerritBase()
1818
protected FormGerritBase(IGitUICommands uiCommands)
1919
: base(true)
2020
{
21-
UICommands = uiCommands;
21+
UiCommands = uiCommands;
2222
}
2323

2424
protected override void OnLoad(EventArgs e)

src/GitExtensions.GerritPlugin/FormGerritDownload.cs

Lines changed: 18 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,7 @@ private async Task<bool> DownloadChangeAsync(IWin32Window owner)
112112
string branchName = "review/" + author + "/" + topic;
113113
var refSpec = (string)((JValue)patchSetInfo["ref"]).Value;
114114

115-
var fetchCommand = UICommands.CreateRemoteCommand();
115+
var fetchCommand = UiCommands.CreateRemoteCommand();
116116

117117
fetchCommand.CommandText = FetchCommand(_NO_TRANSLATE_Remotes.Text, refSpec);
118118

@@ -121,37 +121,34 @@ private async Task<bool> DownloadChangeAsync(IWin32Window owner)
121121
return false;
122122
}
123123

124-
var checkoutCommand = UICommands.CreateRemoteCommand();
124+
var checkoutCommand = UiCommands.CreateRemoteCommand();
125125

126126
checkoutCommand.CommandText = GitCommandHelpers.BranchCmd(branchName, "FETCH_HEAD", true);
127127
checkoutCommand.Completed += (s, e) =>
128128
{
129-
if (e.IsError)
129+
if (e.IsError && e.Command.CommandText.Contains("already exists"))
130130
{
131-
if (e.Command.CommandText.Contains("already exists"))
132-
{
133-
// Recycle the current review branch.
134-
135-
var recycleCommand = UICommands.CreateRemoteCommand();
131+
// Recycle the current review branch.
136132

137-
recycleCommand.CommandText = "checkout " + branchName;
133+
var recycleCommand = UiCommands.CreateRemoteCommand();
138134

139-
if (!RunCommand(recycleCommand, change))
140-
{
141-
return;
142-
}
135+
recycleCommand.CommandText = "checkout " + branchName;
143136

144-
var resetCommand = UICommands.CreateRemoteCommand();
137+
if (!RunCommand(recycleCommand, change))
138+
{
139+
return;
140+
}
145141

146-
resetCommand.CommandText = GitCommandHelpers.ResetCmd(ResetMode.Hard, "FETCH_HEAD");
142+
var resetCommand = UiCommands.CreateRemoteCommand();
147143

148-
if (!RunCommand(resetCommand, change))
149-
{
150-
return;
151-
}
144+
resetCommand.CommandText = GitCommandHelpers.ResetCmd(ResetMode.Hard, "FETCH_HEAD");
152145

153-
e = new GitRemoteCommandCompletedEventArgs(e.Command, false, e.Handled);
146+
if (!RunCommand(resetCommand, change))
147+
{
148+
return;
154149
}
150+
151+
e = new GitRemoteCommandCompletedEventArgs(e.Command, false, e.Handled);
155152
}
156153
};
157154

@@ -253,7 +250,7 @@ private void FormGerritDownloadLoad(object sender, EventArgs e)
253250

254251
private void AddRemoteClick(object sender, EventArgs e)
255252
{
256-
UICommands.StartRemotesDialog(this);
253+
UiCommands.StartRemotesDialog(this);
257254
_NO_TRANSLATE_Remotes.DataSource = Module.GetRemoteNames();
258255
}
259256
}

src/GitExtensions.GerritPlugin/FormGerritPublish.cs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,12 +86,12 @@ private bool PublishChange(IWin32Window owner)
8686

8787
var builder = _capabilities.NewBuilder()
8888
.WithReviewers(_NO_TRANSLATE_Reviewers.Text)
89-
.WithCC(_NO_TRANSLATE_Cc.Text)
89+
.WithCc(_NO_TRANSLATE_Cc.Text)
9090
.WithTopic(_NO_TRANSLATE_Topic.Text)
9191
.WithHashTag(_NO_TRANSLATE_Hashtag.Text)
9292
.WithPublishType(((KeyValuePair<string, string>)PublishType.SelectedItem).Value);
9393

94-
var pushCommand = UICommands.CreateRemoteCommand();
94+
var pushCommand = UiCommands.CreateRemoteCommand();
9595
pushCommand.CommandText = PushCmd(
9696
remote,
9797
builder.Build(branch));
@@ -201,7 +201,7 @@ private void FormGerritPublishLoad(object sender, EventArgs e)
201201

202202
private void AddRemoteClick(object sender, EventArgs e)
203203
{
204-
UICommands.StartRemotesDialog(this);
204+
UiCommands.StartRemotesDialog(this);
205205
_NO_TRANSLATE_Remotes.DataSource = Module.GetRemoteNames();
206206
}
207207
}

src/GitExtensions.GerritPlugin/FormGitReview.Designer.cs

Lines changed: 107 additions & 107 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)