Skip to content

Commit cf5b708

Browse files
committed
revert: remove remote.<name>.pruneTags configuration support (#1692)
Signed-off-by: leo <[email protected]>
1 parent 5289d01 commit cf5b708

File tree

5 files changed

+5
-40
lines changed

5 files changed

+5
-40
lines changed

src/Resources/Locales/en_US.axaml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -612,8 +612,6 @@
612612
<x:String x:Key="Text.Remote.EditTitle" xml:space="preserve">Edit Remote</x:String>
613613
<x:String x:Key="Text.Remote.Name" xml:space="preserve">Name:</x:String>
614614
<x:String x:Key="Text.Remote.Name.Placeholder" xml:space="preserve">Remote name</x:String>
615-
<x:String x:Key="Text.Remote.PruneTagsOnFetch" xml:space="preserve">Prune tags that do not exists in this remote</x:String>
616-
<x:String x:Key="Text.Remote.PruneTagsOnFetch.Tip" xml:space="preserve">Only works while fetching with `--prune` enabled</x:String>
617615
<x:String x:Key="Text.Remote.URL" xml:space="preserve">Repository URL:</x:String>
618616
<x:String x:Key="Text.Remote.URL.Placeholder" xml:space="preserve">Remote git repository URL</x:String>
619617
<x:String x:Key="Text.RemoteCM.CopyURL" xml:space="preserve">Copy URL</x:String>

src/ViewModels/AddRemote.cs

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -44,12 +44,6 @@ public string SSHKey
4444
set => SetProperty(ref _sshkey, value, true);
4545
}
4646

47-
public bool PruneTagsOnFetch
48-
{
49-
get;
50-
set;
51-
} = false;
52-
5347
public AddRemote(Repository repo)
5448
{
5549
_repo = repo;
@@ -111,11 +105,6 @@ public override async Task<bool> Sure()
111105
.Use(log)
112106
.SetAsync($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
113107

114-
if (PruneTagsOnFetch)
115-
await new Commands.Config(_repo.FullPath)
116-
.Use(log)
117-
.SetAsync($"remote.{_name}.pruneTags", "true");
118-
119108
await new Commands.Fetch(_repo.FullPath, _name, false, false)
120109
.Use(log)
121110
.RunAsync();

src/ViewModels/EditRemote.cs

Lines changed: 3 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
using System;
2-
using System.ComponentModel.DataAnnotations;
1+
using System.ComponentModel.DataAnnotations;
32
using System.IO;
43
using System.Threading.Tasks;
54

@@ -45,12 +44,6 @@ public string SSHKey
4544
set => SetProperty(ref _sshkey, value, true);
4645
}
4746

48-
public bool PruneTagsOnFetch
49-
{
50-
get;
51-
set;
52-
}
53-
5447
public EditRemote(Repository repo, Models.Remote remote)
5548
{
5649
_repo = repo;
@@ -59,11 +52,8 @@ public EditRemote(Repository repo, Models.Remote remote)
5952
_url = remote.URL;
6053
_useSSH = Models.Remote.IsSSH(remote.URL);
6154

62-
var config = new Commands.Config(repo.FullPath);
6355
if (_useSSH)
64-
_sshkey = config.Get($"remote.{remote.Name}.sshkey");
65-
66-
PruneTagsOnFetch = config.Get($"remote.{remote.Name}.pruneTags").Equals("true", StringComparison.OrdinalIgnoreCase);
56+
_sshkey = new Commands.Config(repo.FullPath).Get($"remote.{remote.Name}.sshkey");
6757
}
6858

6959
public static ValidationResult ValidateRemoteName(string name, ValidationContext ctx)
@@ -131,9 +121,7 @@ public override async Task<bool> Sure()
131121
if (pushURL != _url)
132122
await new Commands.Remote(_repo.FullPath).SetURLAsync(_name, _url, true);
133123

134-
var config = new Commands.Config(_repo.FullPath);
135-
await config.SetAsync($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
136-
await config.SetAsync($"remote.{_name}.pruneTags", PruneTagsOnFetch ? "true" : null);
124+
await new Commands.Config(_repo.FullPath).SetAsync($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
137125

138126
_repo.SetWatcherEnabled(true);
139127
return true;

src/Views/AddRemote.axaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Classes="bold"
1313
Text="{DynamicResource Text.Remote.AddTitle}"/>
1414

15-
<Grid Margin="0,16,0,0" RowDefinitions="32,32,Auto,32" ColumnDefinitions="120,*">
15+
<Grid Margin="0,16,0,0" RowDefinitions="32,32,Auto" ColumnDefinitions="120,*">
1616
<TextBlock Grid.Row="0" Grid.Column="0"
1717
HorizontalAlignment="Right" VerticalAlignment="Center"
1818
Margin="0,0,8,0"
@@ -55,11 +55,6 @@
5555
</TextBox.InnerRightContent>
5656
</TextBox>
5757
</Border>
58-
59-
<CheckBox Grid.Row="3" Grid.Column="1"
60-
Content="{DynamicResource Text.Remote.PruneTagsOnFetch}"
61-
IsChecked="{Binding PruneTagsOnFetch, Mode=TwoWay}"
62-
ToolTip.Tip="{DynamicResource Text.Remote.PruneTagsOnFetch.Tip}"/>
6358
</Grid>
6459
</StackPanel>
6560
</UserControl>

src/Views/EditRemote.axaml

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
Classes="bold"
1313
Text="{DynamicResource Text.Remote.EditTitle}"/>
1414

15-
<Grid Margin="0,16,0,0" RowDefinitions="32,32,Auto,32" ColumnDefinitions="150,*">
15+
<Grid Margin="0,16,0,0" RowDefinitions="32,32,Auto" ColumnDefinitions="150,*">
1616
<TextBlock Grid.Row="0" Grid.Column="0"
1717
HorizontalAlignment="Right" VerticalAlignment="Center"
1818
Margin="0,0,8,0"
@@ -55,11 +55,6 @@
5555
</TextBox.InnerRightContent>
5656
</TextBox>
5757
</Border>
58-
59-
<CheckBox Grid.Row="3" Grid.Column="1"
60-
Content="{DynamicResource Text.Remote.PruneTagsOnFetch}"
61-
IsChecked="{Binding PruneTagsOnFetch, Mode=TwoWay}"
62-
ToolTip.Tip="{DynamicResource Text.Remote.PruneTagsOnFetch.Tip}"/>
6358
</Grid>
6459
</StackPanel>
6560
</UserControl>

0 commit comments

Comments
 (0)