feature: supports --no-tags on fetch and pull operation (#226)

This commit is contained in:
leo 2024-07-01 16:19:08 +08:00
parent de1a4d14e8
commit 6dad466eef
No known key found for this signature in database
10 changed files with 46 additions and 12 deletions

View file

@ -26,14 +26,19 @@ namespace SourceGit.ViewModels
{
get;
set;
}
} = true;
public bool NoTags
{
get;
set;
} = false;
public Fetch(Repository repo, Models.Remote preferedRemote = null)
{
_repo = repo;
_fetchAllRemotes = preferedRemote == null;
SelectedRemote = preferedRemote != null ? preferedRemote : _repo.Remotes[0];
Prune = true;
View = new Views.Fetch() { DataContext = this };
}
@ -47,13 +52,13 @@ namespace SourceGit.ViewModels
foreach (var remote in _repo.Remotes)
{
SetProgressDescription($"Fetching remote: {remote.Name}");
new Commands.Fetch(_repo.FullPath, remote.Name, Prune, SetProgressDescription).Exec();
new Commands.Fetch(_repo.FullPath, remote.Name, Prune, NoTags, SetProgressDescription).Exec();
}
}
else
{
SetProgressDescription($"Fetching remote: {SelectedRemote.Name}");
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, Prune, SetProgressDescription).Exec();
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, Prune, NoTags, SetProgressDescription).Exec();
}
CallUIThread(() => _repo.SetWatcherEnabled(true));