<fix>(*): 撤销了 commit ceff6ef102

This commit is contained in:
ZCShou 2020-07-30 13:59:12 +08:00
parent a41c7a7b1c
commit 9ea9d18a4d
9 changed files with 25 additions and 83 deletions

View file

@ -57,7 +57,7 @@ namespace SourceGit.Git {
if (errs != null) { if (errs != null) {
App.RaiseError(errs); App.RaiseError(errs);
} else { } else {
repo.Fetch(new Remote() { Name = name }, "--recurse-submodules=on-demand", true, null); repo.Fetch(new Remote() { Name = name }, true, null);
} }
} }

View file

@ -455,13 +455,12 @@ namespace SourceGit.Git {
/// Fetch remote changes /// Fetch remote changes
/// </summary> /// </summary>
/// <param name="remote"></param> /// <param name="remote"></param>
/// <param name="submod">submod</param>
/// <param name="prune"></param> /// <param name="prune"></param>
/// <param name="onProgress"></param> /// <param name="onProgress"></param>
public void Fetch(Remote remote, string submod, bool prune, Action<string> onProgress) { public void Fetch(Remote remote, bool prune, Action<string> onProgress) {
isWatcherDisabled = true; isWatcherDisabled = true;
var args = $"-c credential.helper=manager fetch --progress --verbose {submod} "; var args = "-c credential.helper=manager fetch --progress --verbose ";
if (prune) args += "--prune "; if (prune) args += "--prune ";
@ -485,15 +484,14 @@ namespace SourceGit.Git {
/// </summary> /// </summary>
/// <param name="remote">remote</param> /// <param name="remote">remote</param>
/// <param name="branch">branch</param> /// <param name="branch">branch</param>
/// <param name="submod">submod</param>
/// <param name="onProgress">Progress message handler.</param> /// <param name="onProgress">Progress message handler.</param>
/// <param name="rebase">Use rebase instead of merge.</param> /// <param name="rebase">Use rebase instead of merge.</param>
/// <param name="autostash">Auto stash local changes.</param> /// <param name="autostash">Auto stash local changes.</param>
/// <param name="onProgress">Progress message handler.</param> /// <param name="onProgress">Progress message handler.</param>
public void Pull(string remote, string branch, string submod, Action<string> onProgress, bool rebase = false, bool autostash = false) { public void Pull(string remote, string branch, Action<string> onProgress, bool rebase = false, bool autostash = false) {
isWatcherDisabled = true; isWatcherDisabled = true;
var args = $"-c credential.helper=manager pull --verbose --progress {submod} "; var args = "-c credential.helper=manager pull --verbose --progress ";
var needPopStash = false; var needPopStash = false;
if (rebase) args += "--rebase "; if (rebase) args += "--rebase ";
@ -531,15 +529,14 @@ namespace SourceGit.Git {
/// <param name="remote">Remote</param> /// <param name="remote">Remote</param>
/// <param name="localBranch">Local branch name</param> /// <param name="localBranch">Local branch name</param>
/// <param name="remoteBranch">Remote branch name</param> /// <param name="remoteBranch">Remote branch name</param>
/// <param name="submod">submod</param>
/// <param name="onProgress">Progress message handler.</param> /// <param name="onProgress">Progress message handler.</param>
/// <param name="withTags">Push tags</param> /// <param name="withTags">Push tags</param>
/// <param name="track">Create track reference</param> /// <param name="track">Create track reference</param>
/// <param name="force">Force push</param> /// <param name="force">Force push</param>
public void Push(string remote, string localBranch, string remoteBranch, string submod, Action<string> onProgress, bool withTags = false, bool track = false, bool force = false) { public void Push(string remote, string localBranch, string remoteBranch, Action<string> onProgress, bool withTags = false, bool track = false, bool force = false) {
isWatcherDisabled = true; isWatcherDisabled = true;
var args = $"-c credential.helper=manager push --progress --verbose {submod} "; var args = "-c credential.helper=manager push --progress --verbose ";
if (withTags) args += "--tags "; if (withTags) args += "--tags ";
if (track) args += "-u "; if (track) args += "-u ";

View file

@ -9,7 +9,7 @@
<Description>OpenSource GIT client for Windows</Description> <Description>OpenSource GIT client for Windows</Description>
<Copyright>Copyright © sourcegit 2020. All rights reserved.</Copyright> <Copyright>Copyright © sourcegit 2020. All rights reserved.</Copyright>
<ApplicationManifest>App.manifest</ApplicationManifest> <ApplicationManifest>App.manifest</ApplicationManifest>
<Version>1.4</Version> <Version>2.0.0-preview</Version>
<PackageLicenseExpression>MIT</PackageLicenseExpression> <PackageLicenseExpression>MIT</PackageLicenseExpression>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">

View file

@ -6,7 +6,7 @@
xmlns:git="clr-namespace:SourceGit.Git" xmlns:git="clr-namespace:SourceGit.Git"
xmlns:converters="clr-namespace:SourceGit.Converters" xmlns:converters="clr-namespace:SourceGit.Converters"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="192" d:DesignWidth="500" Height="224" Width="500"> d:DesignHeight="192" d:DesignWidth="500" Height="192" Width="500">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
@ -14,7 +14,6 @@
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition Height="16"/> <RowDefinition Height="16"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
</Grid.RowDefinitions> </Grid.RowDefinitions>
@ -42,24 +41,17 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<Label Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/> <CheckBox Grid.Row="3" Grid.Column="1"
<StackPanel Grid.Row="3" Grid.Column="1" Orientation="Horizontal">
<RadioButton x:Name="RbtnRrsSubModYes" Content="Yes" GroupName="RecurseSubmodules"/>
<RadioButton x:Name="RbtnRrsSubModDemand" Content="On-Demand" Margin="8,0,0,0" GroupName="RecurseSubmodules" IsChecked="True"/>
<RadioButton x:Name="RbtnRrsSubModNo" Content="No" Margin="8,0,0,0" GroupName="RecurseSubmodules"/>
</StackPanel>
<CheckBox Grid.Row="4" Grid.Column="1"
x:Name="chkFetchAll" x:Name="chkFetchAll"
IsChecked="True" IsChecked="True"
Content="Fetch all remotes"/> Content="Fetch all remotes"/>
<CheckBox Grid.Row="5" Grid.Column="1" <CheckBox Grid.Row="4" Grid.Column="1"
x:Name="chkPrune" x:Name="chkPrune"
IsChecked="True" IsChecked="True"
Content="Prune remote dead branches"/> Content="Prune remote dead branches"/>
<Grid Grid.Row="7" Grid.ColumnSpan="2"> <Grid Grid.Row="6" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/>

View file

@ -50,23 +50,14 @@ namespace SourceGit.UI {
/// <param name="e"></param> /// <param name="e"></param>
private async void Start(object sender, RoutedEventArgs e) { private async void Start(object sender, RoutedEventArgs e) {
bool prune = chkPrune.IsChecked == true; bool prune = chkPrune.IsChecked == true;
string subMod;
if (RbtnRrsSubModYes.IsChecked == true) {
subMod = "--recurse-submodules=yes";
} else if (RbtnRrsSubModNo.IsChecked == true) {
subMod = "--recurse-submodules=no";
} else {
subMod = "--recurse-submodules=on-demand";
}
PopupManager.Lock(); PopupManager.Lock();
if (chkFetchAll.IsChecked == true) { if (chkFetchAll.IsChecked == true) {
await Task.Run(() => repo.Fetch(null, subMod, prune, PopupManager.UpdateStatus)); await Task.Run(() => repo.Fetch(null, prune, PopupManager.UpdateStatus));
} else { } else {
var remote = combRemotes.SelectedItem as Git.Remote; var remote = combRemotes.SelectedItem as Git.Remote;
await Task.Run(() => repo.Fetch(remote, subMod, prune, PopupManager.UpdateStatus)); await Task.Run(() => repo.Fetch(remote, prune, PopupManager.UpdateStatus));
} }
PopupManager.Close(true); PopupManager.Close(true);

View file

@ -4,7 +4,7 @@
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="248" d:DesignWidth="500" Height="280" Width="500"> d:DesignHeight="248" d:DesignWidth="500" Height="248" Width="500">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
@ -12,7 +12,6 @@
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="16"/> <RowDefinition Height="16"/>
@ -61,26 +60,19 @@
<Label x:Name="txtInto" VerticalAlignment="Center"/> <Label x:Name="txtInto" VerticalAlignment="Center"/>
</StackPanel> </StackPanel>
<Label Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/> <CheckBox Grid.Row="5" Grid.Column="1"
<StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal">
<RadioButton x:Name="RbtnRrsSubModYes" Content="Yes" GroupName="RecurseSubmodules"/>
<RadioButton x:Name="RbtnRrsSubModDemand" Content="On-Demand" Margin="8,0,0,0" GroupName="RecurseSubmodules" IsChecked="True"/>
<RadioButton x:Name="RbtnRrsSubModNo" Content="No" Margin="8,0,0,0" GroupName="RecurseSubmodules"/>
</StackPanel>
<CheckBox Grid.Row="6" Grid.Column="1"
x:Name="chkRebase" x:Name="chkRebase"
IsChecked="True" IsChecked="True"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Use rebase instead of merge"/> Content="Use rebase instead of merge"/>
<CheckBox Grid.Row="7" Grid.Column="1" <CheckBox Grid.Row="6" Grid.Column="1"
x:Name="chkAutoStash" x:Name="chkAutoStash"
IsChecked="True" IsChecked="True"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Stash &amp; reapply local changes"/> Content="Stash &amp; reapply local changes"/>
<Grid Grid.Row="9" Grid.ColumnSpan="2"> <Grid Grid.Row="8" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/>

View file

@ -76,17 +76,8 @@ namespace SourceGit.UI {
if (remote == null || branch == null) return; if (remote == null || branch == null) return;
string subMod;
if (RbtnRrsSubModYes.IsChecked == true) {
subMod = "--recurse-submodules=yes";
} else if (RbtnRrsSubModNo.IsChecked == true) {
subMod = "--recurse-submodules=no";
} else {
subMod = "--recurse-submodules=on-demand";
}
PopupManager.Lock(); PopupManager.Lock();
await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), subMod, PopupManager.UpdateStatus, rebase, autoStash)); await Task.Run(() => repo.Pull(remote, branch.Substring(branch.IndexOf('/')+1), PopupManager.UpdateStatus, rebase, autoStash));
PopupManager.Close(true); PopupManager.Close(true);
} }

View file

@ -5,7 +5,7 @@
xmlns:d="http://schemas.microsoft.com/expression/blend/2008" xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:git="clr-namespace:SourceGit.Git" xmlns:git="clr-namespace:SourceGit.Git"
mc:Ignorable="d" mc:Ignorable="d"
d:DesignHeight="248" d:DesignWidth="500" Height="280" Width="500"> d:DesignHeight="248" d:DesignWidth="500" Height="248" Width="500">
<Grid> <Grid>
<Grid.RowDefinitions> <Grid.RowDefinitions>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
@ -13,7 +13,6 @@
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/> <RowDefinition Height="32"/>
<RowDefinition Height="32"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="28"/> <RowDefinition Height="28"/>
<RowDefinition Height="16"/> <RowDefinition Height="16"/>
@ -71,25 +70,17 @@
</ComboBox.ItemTemplate> </ComboBox.ItemTemplate>
</ComboBox> </ComboBox>
<Label Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/> <CheckBox Grid.Row="5" Grid.Column="1"
<StackPanel Grid.Row="5" Grid.Column="1" Orientation="Horizontal">
<RadioButton x:Name="RbtnRrsSubModCheck" Content="Check" GroupName="RecurseSubmodules"/>
<RadioButton x:Name="RbtnRrsSubModDemand" Content="On-Demand" Margin="8,0,0,0" GroupName="RecurseSubmodules" />
<RadioButton x:Name="RbtnRrsSubModOnly" Content="Only" Margin="8,0,0,0" GroupName="RecurseSubmodules"/>
<RadioButton x:Name="RbtnRrsSubModNo" Content="No" Margin="8,0,0,0" GroupName="RecurseSubmodules" IsChecked="True"/>
</StackPanel>
<CheckBox Grid.Row="6" Grid.Column="1"
x:Name="chkTags" x:Name="chkTags"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Push all tags"/> Content="Push all tags"/>
<CheckBox Grid.Row="7" Grid.Column="1" <CheckBox Grid.Row="6" Grid.Column="1"
x:Name="chkForce" x:Name="chkForce"
VerticalAlignment="Center" VerticalAlignment="Center"
Content="Force push"/> Content="Force push"/>
<Grid Grid.Row="9" Grid.ColumnSpan="2"> <Grid Grid.Row="8" Grid.ColumnSpan="2">
<Grid.ColumnDefinitions> <Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/> <ColumnDefinition Width="*"/>
<ColumnDefinition Width="80"/> <ColumnDefinition Width="80"/>

View file

@ -53,7 +53,7 @@ namespace SourceGit.UI {
var remoteBranch = upstream.Substring(remoteIdx + 1); var remoteBranch = upstream.Substring(remoteIdx + 1);
Task.Run(() => { Task.Run(() => {
repo.Push(remote, current.Name, remoteBranch, "--recurse-submodules=no", PopupManager.UpdateStatus); repo.Push(remote, current.Name, remoteBranch, PopupManager.UpdateStatus);
push.Dispatcher.Invoke(() => { push.Dispatcher.Invoke(() => {
PopupManager.Close(true); PopupManager.Close(true);
}); });
@ -90,18 +90,6 @@ namespace SourceGit.UI {
var track = string.IsNullOrEmpty(localBranch.Upstream); var track = string.IsNullOrEmpty(localBranch.Upstream);
var tags = chkTags.IsChecked == true; var tags = chkTags.IsChecked == true;
var force = chkForce.IsChecked == true; var force = chkForce.IsChecked == true;
string subMod;
if (RbtnRrsSubModCheck.IsChecked == true) {
subMod = "--recurse-submodules=check";
} else if (RbtnRrsSubModDemand.IsChecked == true) {
subMod = "--recurse-submodules=on-demand";
}
else if (RbtnRrsSubModOnly.IsChecked == true) {
subMod = "--recurse-submodules=only";
} else{
subMod = "--recurse-submodules=no";
}
remoteBranch = remoteBranch.Substring($"{remote}/".Length); remoteBranch = remoteBranch.Substring($"{remote}/".Length);
if (remoteBranch.Contains(" (new)")) { if (remoteBranch.Contains(" (new)")) {
@ -109,7 +97,7 @@ namespace SourceGit.UI {
} }
PopupManager.Lock(); PopupManager.Lock();
await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, subMod, PopupManager.UpdateStatus, tags, track, force)); await Task.Run(() => repo.Push(remote, localBranch.Name, remoteBranch, PopupManager.UpdateStatus, tags, track, force));
PopupManager.Close(true); PopupManager.Close(true);
} }