mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-10-31 13:03:20 -07:00
<fix>(*): 撤销了 commit ceff6ef102
This commit is contained in:
parent
a41c7a7b1c
commit
9ea9d18a4d
9 changed files with 25 additions and 83 deletions
|
@ -57,7 +57,7 @@ namespace SourceGit.Git {
|
|||
if (errs != null) {
|
||||
App.RaiseError(errs);
|
||||
} else {
|
||||
repo.Fetch(new Remote() { Name = name }, "--recurse-submodules=on-demand", true, null);
|
||||
repo.Fetch(new Remote() { Name = name }, true, null);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -455,13 +455,12 @@ namespace SourceGit.Git {
|
|||
/// Fetch remote changes
|
||||
/// </summary>
|
||||
/// <param name="remote"></param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="prune"></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;
|
||||
|
||||
var args = $"-c credential.helper=manager fetch --progress --verbose {submod} ";
|
||||
var args = "-c credential.helper=manager fetch --progress --verbose ";
|
||||
|
||||
if (prune) args += "--prune ";
|
||||
|
||||
|
@ -485,15 +484,14 @@ namespace SourceGit.Git {
|
|||
/// </summary>
|
||||
/// <param name="remote">remote</param>
|
||||
/// <param name="branch">branch</param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="onProgress">Progress message handler.</param>
|
||||
/// <param name="rebase">Use rebase instead of merge.</param>
|
||||
/// <param name="autostash">Auto stash local changes.</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;
|
||||
|
||||
var args = $"-c credential.helper=manager pull --verbose --progress {submod} ";
|
||||
var args = "-c credential.helper=manager pull --verbose --progress ";
|
||||
var needPopStash = false;
|
||||
|
||||
if (rebase) args += "--rebase ";
|
||||
|
@ -531,15 +529,14 @@ namespace SourceGit.Git {
|
|||
/// <param name="remote">Remote</param>
|
||||
/// <param name="localBranch">Local branch name</param>
|
||||
/// <param name="remoteBranch">Remote branch name</param>
|
||||
/// <param name="submod">submod</param>
|
||||
/// <param name="onProgress">Progress message handler.</param>
|
||||
/// <param name="withTags">Push tags</param>
|
||||
/// <param name="track">Create track reference</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;
|
||||
|
||||
var args = $"-c credential.helper=manager push --progress --verbose {submod} ";
|
||||
var args = "-c credential.helper=manager push --progress --verbose ";
|
||||
|
||||
if (withTags) args += "--tags ";
|
||||
if (track) args += "-u ";
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
<Description>OpenSource GIT client for Windows</Description>
|
||||
<Copyright>Copyright © sourcegit 2020. All rights reserved.</Copyright>
|
||||
<ApplicationManifest>App.manifest</ApplicationManifest>
|
||||
<Version>1.4</Version>
|
||||
<Version>2.0.0-preview</Version>
|
||||
<PackageLicenseExpression>MIT</PackageLicenseExpression>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
xmlns:git="clr-namespace:SourceGit.Git"
|
||||
xmlns:converters="clr-namespace:SourceGit.Converters"
|
||||
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.RowDefinitions>
|
||||
<RowDefinition Height="32"/>
|
||||
|
@ -14,7 +14,6 @@
|
|||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="16"/>
|
||||
<RowDefinition Height="32"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
@ -42,24 +41,17 @@
|
|||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Label Grid.Row="3" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/>
|
||||
<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"
|
||||
<CheckBox Grid.Row="3" Grid.Column="1"
|
||||
x:Name="chkFetchAll"
|
||||
IsChecked="True"
|
||||
Content="Fetch all remotes"/>
|
||||
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
<CheckBox Grid.Row="4" Grid.Column="1"
|
||||
x:Name="chkPrune"
|
||||
IsChecked="True"
|
||||
Content="Prune remote dead branches"/>
|
||||
|
||||
<Grid Grid.Row="7" Grid.ColumnSpan="2">
|
||||
<Grid Grid.Row="6" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
|
|
|
@ -51,22 +51,13 @@ namespace SourceGit.UI {
|
|||
private async void Start(object sender, RoutedEventArgs e) {
|
||||
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();
|
||||
|
||||
if (chkFetchAll.IsChecked == true) {
|
||||
await Task.Run(() => repo.Fetch(null, subMod, prune, PopupManager.UpdateStatus));
|
||||
await Task.Run(() => repo.Fetch(null, prune, PopupManager.UpdateStatus));
|
||||
} else {
|
||||
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);
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
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.RowDefinitions>
|
||||
<RowDefinition Height="32"/>
|
||||
|
@ -12,7 +12,6 @@
|
|||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="16"/>
|
||||
|
@ -61,26 +60,19 @@
|
|||
<Label x:Name="txtInto" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/>
|
||||
<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"
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
x:Name="chkRebase"
|
||||
IsChecked="True"
|
||||
VerticalAlignment="Center"
|
||||
Content="Use rebase instead of merge"/>
|
||||
|
||||
<CheckBox Grid.Row="7" Grid.Column="1"
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
x:Name="chkAutoStash"
|
||||
IsChecked="True"
|
||||
VerticalAlignment="Center"
|
||||
Content="Stash & reapply local changes"/>
|
||||
|
||||
<Grid Grid.Row="9" Grid.ColumnSpan="2">
|
||||
<Grid Grid.Row="8" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
|
|
|
@ -76,17 +76,8 @@ namespace SourceGit.UI {
|
|||
|
||||
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();
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
|
@ -5,7 +5,7 @@
|
|||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:git="clr-namespace:SourceGit.Git"
|
||||
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.RowDefinitions>
|
||||
<RowDefinition Height="32"/>
|
||||
|
@ -13,7 +13,6 @@
|
|||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="32"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="28"/>
|
||||
<RowDefinition Height="16"/>
|
||||
|
@ -71,25 +70,17 @@
|
|||
</ComboBox.ItemTemplate>
|
||||
</ComboBox>
|
||||
|
||||
<Label Grid.Row="5" Grid.Column="0" HorizontalAlignment="Right" Content="Recurse Submodules :"/>
|
||||
<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"
|
||||
<CheckBox Grid.Row="5" Grid.Column="1"
|
||||
x:Name="chkTags"
|
||||
VerticalAlignment="Center"
|
||||
Content="Push all tags"/>
|
||||
|
||||
<CheckBox Grid.Row="7" Grid.Column="1"
|
||||
<CheckBox Grid.Row="6" Grid.Column="1"
|
||||
x:Name="chkForce"
|
||||
VerticalAlignment="Center"
|
||||
Content="Force push"/>
|
||||
|
||||
<Grid Grid.Row="9" Grid.ColumnSpan="2">
|
||||
<Grid Grid.Row="8" Grid.ColumnSpan="2">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="80"/>
|
||||
|
|
|
@ -53,7 +53,7 @@ namespace SourceGit.UI {
|
|||
var remoteBranch = upstream.Substring(remoteIdx + 1);
|
||||
|
||||
Task.Run(() => {
|
||||
repo.Push(remote, current.Name, remoteBranch, "--recurse-submodules=no", PopupManager.UpdateStatus);
|
||||
repo.Push(remote, current.Name, remoteBranch, PopupManager.UpdateStatus);
|
||||
push.Dispatcher.Invoke(() => {
|
||||
PopupManager.Close(true);
|
||||
});
|
||||
|
@ -91,25 +91,13 @@ namespace SourceGit.UI {
|
|||
var tags = chkTags.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);
|
||||
if (remoteBranch.Contains(" (new)")) {
|
||||
remoteBranch = remoteBranch.Substring(0, remoteBranch.Length - 6);
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue