mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 05:05:00 +00:00

* ViewModels.MergeMode -> Models.MergeMode * ViewModels.Notification -> Models.Notification * ViewModels.ResetMode -> Models.ResetMode * use `int` instead of `ViewModels.CountSelectedCommits`
49 lines
1.2 KiB
C#
49 lines
1.2 KiB
C#
using System.Threading.Tasks;
|
|
|
|
namespace SourceGit.ViewModels
|
|
{
|
|
public class Merge : Popup
|
|
{
|
|
public string Source
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public string Into
|
|
{
|
|
get;
|
|
private set;
|
|
}
|
|
|
|
public Models.MergeMode SelectedMode
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public Merge(Repository repo, string source, string into)
|
|
{
|
|
_repo = repo;
|
|
Source = source;
|
|
Into = into;
|
|
SelectedMode = Models.MergeMode.Supported[0];
|
|
View = new Views.Merge() { DataContext = this };
|
|
}
|
|
|
|
public override Task<bool> Sure()
|
|
{
|
|
_repo.SetWatcherEnabled(false);
|
|
ProgressDescription = $"Merging '{Source}' into '{Into}' ...";
|
|
|
|
return Task.Run(() =>
|
|
{
|
|
var succ = new Commands.Merge(_repo.FullPath, Source, SelectedMode.Arg, SetProgressDescription).Exec();
|
|
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
|
return succ;
|
|
});
|
|
}
|
|
|
|
private readonly Repository _repo = null;
|
|
}
|
|
}
|