feature: allow fetch the latest remote changes into local branch which is not current branch (#617)

Signed-off-by: leo <longshuang@msn.cn>
This commit is contained in:
leo 2024-10-29 09:59:13 +08:00
parent 489b57858f
commit 1442dcfe00
No known key found for this signature in database
8 changed files with 102 additions and 2 deletions

View file

@ -0,0 +1,42 @@
using System.Threading.Tasks;
namespace SourceGit.ViewModels
{
public class FetchInto : Popup
{
public Models.Branch Local
{
get;
private set;
}
public Models.Branch Upstream
{
get;
private set;
}
public FetchInto(Repository repo, Models.Branch local, Models.Branch upstream)
{
_repo = repo;
Local = local;
Upstream = upstream;
View = new Views.FetchInto() { DataContext = this };
}
public override Task<bool> Sure()
{
_repo.SetWatcherEnabled(false);
ProgressDescription = "Fast-Forward ...";
return Task.Run(() =>
{
new Commands.Fetch(_repo.FullPath, Local, Upstream, SetProgressDescription).Exec();
CallUIThread(() => _repo.SetWatcherEnabled(true));
return true;
});
}
private readonly Repository _repo = null;
}
}