Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/Models/RepositorySettings.cs
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,12 @@ public bool EnableForceOnFetch
set;
} = false;

public bool FetchAllRemotes
{
get;
set;
} = false;

public bool FetchWithoutTags
{
get;
Expand Down
15 changes: 11 additions & 4 deletions src/ViewModels/Fetch.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand All @@ -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)
{
Expand All @@ -66,10 +71,11 @@ public override async Task<bool> 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)
Expand Down Expand Up @@ -98,5 +104,6 @@ public override async Task<bool> Sure()
}

private readonly Repository _repo = null;
private bool _fetchAllRemotes;
}
}
Loading