mirror of
https://github.com/sourcegit-scm/sourcegit.git
synced 2024-12-24 20:57:19 -08:00
refactor: rewrite branch auto-select after remote changed while pulling (#342)
This commit is contained in:
parent
f98423b4c7
commit
3a54471ea5
1 changed files with 16 additions and 17 deletions
|
@ -182,9 +182,8 @@ namespace SourceGit.ViewModels
|
|||
RemoteBranches = branches;
|
||||
|
||||
var autoSelectedBranch = false;
|
||||
if (!string.IsNullOrEmpty(_current.Upstream))
|
||||
{
|
||||
if (_current.Upstream.StartsWith($"refs/remotes/{remoteName}/", System.StringComparison.Ordinal))
|
||||
if (!string.IsNullOrEmpty(_current.Upstream) &&
|
||||
_current.Upstream.StartsWith($"refs/remotes/{remoteName}/", System.StringComparison.Ordinal))
|
||||
{
|
||||
foreach (var branch in branches)
|
||||
{
|
||||
|
@ -196,7 +195,8 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
|
||||
if (!autoSelectedBranch)
|
||||
{
|
||||
foreach (var branch in branches)
|
||||
{
|
||||
|
@ -208,7 +208,6 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (!autoSelectedBranch)
|
||||
SelectedBranch = branches.Count > 0 ? branches[0] : null;
|
||||
|
|
Loading…
Reference in a new issue