mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-22 04:34: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
|
@ -18,6 +18,24 @@ namespace SourceGit.ViewModels
|
|||
set;
|
||||
}
|
||||
|
||||
public List<string> Remotes
|
||||
{
|
||||
get;
|
||||
}
|
||||
|
||||
public string DefaultRemote
|
||||
{
|
||||
get => _repo.Settings.DefaultRemote;
|
||||
set
|
||||
{
|
||||
if (_repo.Settings.DefaultRemote != value)
|
||||
{
|
||||
_repo.Settings.DefaultRemote = value;
|
||||
OnPropertyChanged();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public bool GPGCommitSigningEnabled
|
||||
{
|
||||
get;
|
||||
|
@ -88,6 +106,10 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
_repo = repo;
|
||||
|
||||
Remotes = new List<string>();
|
||||
foreach (var remote in _repo.Remotes)
|
||||
Remotes.Add(remote.Name);
|
||||
|
||||
_cached = new Commands.Config(repo.FullPath).ListAll();
|
||||
if (_cached.TryGetValue("user.name", out var name))
|
||||
UserName = name;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue