diff --git a/src/Models/RepositorySettings.cs b/src/Models/RepositorySettings.cs index c19fa21e2..1dd194857 100644 --- a/src/Models/RepositorySettings.cs +++ b/src/Models/RepositorySettings.cs @@ -62,6 +62,12 @@ public bool EnableForceOnFetch set; } = false; + public bool FetchAllRemotes + { + get; + set; + } = false; + public bool FetchWithoutTags { get; diff --git a/src/ViewModels/Fetch.cs b/src/ViewModels/Fetch.cs index 575e4b4bf..298da9e15 100644 --- a/src/ViewModels/Fetch.cs +++ b/src/ViewModels/Fetch.cs @@ -18,9 +18,13 @@ public bool IsFetchAllRemoteVisible public bool FetchAllRemotes { - get; - set; - } = false; + get => _fetchAllRemotes; + set + { + _repo.Settings.FetchAllRemotes = value; + SetProperty(ref _fetchAllRemotes, value); + } + } public Models.Remote SelectedRemote { @@ -44,6 +48,7 @@ public Fetch(Repository repo, Models.Remote preferredRemote = null) { _repo = repo; IsFetchAllRemoteVisible = repo.Remotes.Count > 1 && preferredRemote == null; + _fetchAllRemotes = _repo.Settings.FetchAllRemotes; if (preferredRemote != null) { @@ -66,10 +71,11 @@ public override async Task Sure() var notags = _repo.Settings.FetchWithoutTags; var force = _repo.Settings.EnableForceOnFetch; + var all = _repo.Settings.FetchAllRemotes; var log = _repo.CreateLog("Fetch"); Use(log); - if (FetchAllRemotes) + if (all) { foreach (var remote in _repo.Remotes) await new Commands.Fetch(_repo.FullPath, remote.Name, notags, force) @@ -98,5 +104,6 @@ public override async Task Sure() } private readonly Repository _repo = null; + private bool _fetchAllRemotes; } }