feature: allow to ignore local changes also when switching branch or pulling changes (#151)

This commit is contained in:
leo 2024-05-29 16:42:47 +08:00
parent 69f9dceece
commit 0b09d210be
13 changed files with 253 additions and 212 deletions

View file

@ -513,7 +513,7 @@ namespace SourceGit.ViewModels
checkout.Icon = App.CreateMenuIcon("Icons.Check");
checkout.Click += (o, e) =>
{
_repo.CheckoutLocalBranch(branch.Name);
_repo.CheckoutBranch(branch);
e.Handled = true;
};
submenu.Items.Add(checkout);
@ -585,20 +585,7 @@ namespace SourceGit.ViewModels
checkout.Icon = App.CreateMenuIcon("Icons.Check");
checkout.Click += (o, e) =>
{
foreach (var b in _repo.Branches)
{
if (b.IsLocal && b.Upstream == branch.FullName)
{
if (!b.IsCurrent)
_repo.CheckoutLocalBranch(b.Name);
return;
}
}
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new CreateBranch(_repo, branch));
_repo.CheckoutBranch(branch);
e.Handled = true;
};
submenu.Items.Add(checkout);