mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-21 12:15:00 +00:00
enhance: supports to configure fetch.prune
for selected repository (#995)
Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
parent
b5feabfd37
commit
9da2c787db
2 changed files with 15 additions and 2 deletions
|
@ -60,6 +60,12 @@ namespace SourceGit.ViewModels
|
|||
set => SetProperty(ref _httpProxy, value);
|
||||
}
|
||||
|
||||
public bool EnablePruneOnFetch
|
||||
{
|
||||
get;
|
||||
set;
|
||||
}
|
||||
|
||||
public bool EnableAutoFetch
|
||||
{
|
||||
get => _repo.Settings.EnableAutoFetch;
|
||||
|
@ -153,6 +159,8 @@ namespace SourceGit.ViewModels
|
|||
GPGUserSigningKey = signingKey;
|
||||
if (_cached.TryGetValue("http.proxy", out var proxy))
|
||||
HttpProxy = proxy;
|
||||
if (_cached.TryGetValue("fetch.prune", out var prune))
|
||||
EnablePruneOnFetch = (prune == "true");
|
||||
}
|
||||
|
||||
public void ClearHttpProxy()
|
||||
|
@ -286,6 +294,7 @@ namespace SourceGit.ViewModels
|
|||
SetIfChanged("tag.gpgsign", GPGTagSigningEnabled ? "true" : "false", "false");
|
||||
SetIfChanged("user.signingkey", GPGUserSigningKey, "");
|
||||
SetIfChanged("http.proxy", HttpProxy, "");
|
||||
SetIfChanged("fetch.prune", EnablePruneOnFetch ? "true" : "false", "false");
|
||||
}
|
||||
|
||||
private void SetIfChanged(string key, string value, string defValue)
|
||||
|
|
|
@ -44,7 +44,7 @@
|
|||
<TextBlock Classes="tab_header" Text="{DynamicResource Text.Configure.Git}"/>
|
||||
</TabItem.Header>
|
||||
|
||||
<Grid Margin="16,4,16,8" RowDefinitions="32,32,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<Grid Margin="16,4,16,8" RowDefinitions="32,32,32,32,32,32,32,32,32" ColumnDefinitions="Auto,*">
|
||||
<TextBlock Grid.Row="0" Grid.Column="0"
|
||||
HorizontalAlignment="Right" VerticalAlignment="Center"
|
||||
Margin="0,0,8,0"
|
||||
|
@ -119,7 +119,11 @@
|
|||
Content="{DynamicResource Text.Preferences.GPG.TagEnabled}"
|
||||
IsChecked="{Binding GPGTagSigningEnabled, Mode=TwoWay}"/>
|
||||
|
||||
<StackPanel Grid.Row="7" Grid.Column="1" Orientation="Horizontal">
|
||||
<CheckBox Grid.Row="7" Grid.Column="1"
|
||||
Content="{DynamicResource Text.Preferences.Git.EnablePruneOnFetch}"
|
||||
IsChecked="{Binding EnablePruneOnFetch, Mode=TwoWay}"/>
|
||||
|
||||
<StackPanel Grid.Row="8" Grid.Column="1" Orientation="Horizontal">
|
||||
<CheckBox x:Name="AutoFetchCheckBox"
|
||||
Content="{DynamicResource Text.Configure.Git.AutoFetch}"
|
||||
IsChecked="{Binding EnableAutoFetch, Mode=TwoWay}"/>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue