enhance: leave remote branch to empty when the local branch tracks no branch in the remote while pulling changes (#469)

This commit is contained in:
leo 2024-09-13 17:27:56 +08:00
parent ab8b27c1f8
commit 1ec5cc416d
No known key found for this signature in database
2 changed files with 5 additions and 4 deletions

View file

@ -210,7 +210,7 @@ namespace SourceGit.ViewModels
} }
if (!autoSelectedBranch) if (!autoSelectedBranch)
SelectedBranch = branches.Count > 0 ? branches[0] : null; SelectedBranch = null;
} }
private readonly Repository _repo = null; private readonly Repository _repo = null;

View file

@ -490,10 +490,11 @@ namespace SourceGit.ViewModels
return; return;
} }
if (autoStart) var pull = new Pull(this, null);
PopupHost.ShowAndStartPopup(new Pull(this, null)); if (autoStart && pull.SelectedBranch != null)
PopupHost.ShowAndStartPopup(pull);
else else
PopupHost.ShowPopup(new Pull(this, null)); PopupHost.ShowPopup(pull);
} }
public void Push(bool autoStart) public void Push(bool autoStart)