feature: supports to set default remote to push local branches without any tracking remotes (#534)

This commit is contained in:
leo 2024-10-02 15:13:27 +08:00
parent 6d1dfad8a1
commit d746e352a7
No known key found for this signature in database
7 changed files with 66 additions and 10 deletions

View file

@ -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;