mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 20:54:59 +00:00
feature: supports to set default remote to push local branches without any tracking remotes (#534)
This commit is contained in:
parent
6d1dfad8a1
commit
d746e352a7
7 changed files with 66 additions and 10 deletions
|
@ -137,9 +137,15 @@ namespace SourceGit.ViewModels
|
|||
}
|
||||
}
|
||||
|
||||
// Set default remote to the first if haven't been set.
|
||||
// Set default remote to the first if it has not been set.
|
||||
if (_selectedRemote == null)
|
||||
_selectedRemote = repo.Remotes[0];
|
||||
{
|
||||
var remote = null as Models.Remote;
|
||||
if (!string.IsNullOrEmpty(_repo.Settings.DefaultRemote))
|
||||
remote = repo.Remotes.Find(x => x.Name == _repo.Settings.DefaultRemote);
|
||||
|
||||
_selectedRemote = remote ?? repo.Remotes[0];
|
||||
}
|
||||
|
||||
// Auto select preferred remote branch.
|
||||
AutoSelectBranchByRemote();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue