mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
fix<WorkingCopyChanges>: fix that discard all unstaged changes will drop changes staged
This commit is contained in:
parent
0966baa1d8
commit
ed26256c90
3 changed files with 17 additions and 5 deletions
|
@ -10,7 +10,6 @@ using System.Windows.Controls.Primitives;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
using System.Windows.Media;
|
using System.Windows.Media;
|
||||||
using System.Windows.Media.Animation;
|
using System.Windows.Media.Animation;
|
||||||
using System.Windows.Shell;
|
|
||||||
|
|
||||||
namespace SourceGit.Views.Widgets {
|
namespace SourceGit.Views.Widgets {
|
||||||
|
|
||||||
|
|
|
@ -97,6 +97,14 @@ namespace SourceGit.Views.Widgets {
|
||||||
if (watcher != null) watcher.RefreshWC();
|
if (watcher != null) watcher.RefreshWC();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void Discard(List<Models.Change> changes) {
|
||||||
|
if (changes.Count >= unstagedContainer.Changes.Count && stagedContainer.Changes.Count == 0) {
|
||||||
|
new Popups.Discard(repo.Path, null).Show();
|
||||||
|
} else {
|
||||||
|
new Popups.Discard(repo.Path, changes).Show();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#region STAGE_UNSTAGE
|
#region STAGE_UNSTAGE
|
||||||
private void ViewAssumeUnchanged(object sender, RoutedEventArgs e) {
|
private void ViewAssumeUnchanged(object sender, RoutedEventArgs e) {
|
||||||
var dialog = new AssumeUnchanged(repo.Path);
|
var dialog = new AssumeUnchanged(repo.Path);
|
||||||
|
|
|
@ -8,6 +8,7 @@ using System.Threading.Tasks;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
using System.Windows.Input;
|
using System.Windows.Input;
|
||||||
|
using System.Windows.Media;
|
||||||
|
|
||||||
namespace SourceGit.Views.Widgets {
|
namespace SourceGit.Views.Widgets {
|
||||||
/// <summary>
|
/// <summary>
|
||||||
|
@ -385,10 +386,14 @@ namespace SourceGit.Views.Widgets {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void Disard(List<Models.Change> changes) {
|
private void Disard(List<Models.Change> changes) {
|
||||||
if (changes.Count >= Changes.Count) {
|
DependencyObject parent = VisualTreeHelper.GetParent(this);
|
||||||
new Popups.Discard(repo, null).Show();
|
while (parent != null) {
|
||||||
} else {
|
if (parent is WorkingCopy wc) {
|
||||||
new Popups.Discard(repo, changes).Show();
|
wc.Discard(changes);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
parent = VisualTreeHelper.GetParent(parent);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue