mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-06-24 20:05:00 +00:00
fix: delete both case (local & remote-tracking)
- We have local and remote-tracking but not a remote branch. We need to remove both or only the tracking based on the checkbox and on the 'hasRemote' condition
This commit is contained in:
parent
67e3128c80
commit
ec2057dca7
1 changed files with 16 additions and 2 deletions
|
@ -57,9 +57,23 @@ namespace SourceGit.ViewModels
|
||||||
|
|
||||||
if (_alsoDeleteTrackingRemote && TrackingRemoteBranch != null)
|
if (_alsoDeleteTrackingRemote && TrackingRemoteBranch != null)
|
||||||
{
|
{
|
||||||
SetProgressDescription("Deleting remote-tracking branch...");
|
|
||||||
|
if (Commands.Branch.HasRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name))
|
||||||
|
{
|
||||||
|
SetProgressDescription("Deleting remote-tracking branch and remote branch...");
|
||||||
|
|
||||||
Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name);
|
Commands.Branch.DeleteRemote(_repo.FullPath, TrackingRemoteBranch.Remote, TrackingRemoteBranch.Name);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
SetProgressDescription("Deleting remote-tracking branch...");
|
||||||
|
|
||||||
|
var remoteTrackingBranch = $"{TrackingRemoteBranch.Remote}/{TrackingRemoteBranch.Name}";
|
||||||
|
|
||||||
|
Commands.Branch.DeleteRemoteTracking(_repo.FullPath, remoteTrackingBranch);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else if(!Commands.Branch.HasRemote(_repo.FullPath, Target.Remote, Target.Name))
|
else if(!Commands.Branch.HasRemote(_repo.FullPath, Target.Remote, Target.Name))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue