refactor: do NOT use the --prune parameter for git fetch command (#590)

This commit is contained in:
leo 2024-10-22 16:53:48 +08:00
parent 077e35b860
commit b9d7f908c9
No known key found for this signature in database
13 changed files with 7 additions and 27 deletions

View file

@ -100,7 +100,7 @@ namespace SourceGit.ViewModels
{
SetProgressDescription("Fetching from added remote ...");
new Commands.Config(_repo.FullPath).Set($"remote.{_name}.sshkey", _useSSH ? SSHKey : null);
new Commands.Fetch(_repo.FullPath, _name, true, false, SetProgressDescription).Exec();
new Commands.Fetch(_repo.FullPath, _name, false, SetProgressDescription).Exec();
}
CallUIThread(() =>
{

View file

@ -22,12 +22,6 @@ namespace SourceGit.ViewModels
set;
}
public bool Prune
{
get;
set;
} = true;
public bool NoTags
{
get => _repo.Settings.FetchWithoutTags;
@ -53,13 +47,13 @@ namespace SourceGit.ViewModels
foreach (var remote in _repo.Remotes)
{
SetProgressDescription($"Fetching remote: {remote.Name}");
new Commands.Fetch(_repo.FullPath, remote.Name, Prune, NoTags, SetProgressDescription).Exec();
new Commands.Fetch(_repo.FullPath, remote.Name, NoTags, SetProgressDescription).Exec();
}
}
else
{
SetProgressDescription($"Fetching remote: {SelectedRemote.Name}");
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, Prune, NoTags, SetProgressDescription).Exec();
new Commands.Fetch(_repo.FullPath, SelectedRemote.Name, NoTags, SetProgressDescription).Exec();
}
CallUIThread(() =>

View file

@ -147,7 +147,7 @@ namespace SourceGit.ViewModels
if (FetchAllBranches)
{
SetProgressDescription($"Fetching remote: {_selectedRemote.Name}...");
rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, false, NoTags, SetProgressDescription).Exec();
rs = new Commands.Fetch(_repo.FullPath, _selectedRemote.Name, NoTags, SetProgressDescription).Exec();
if (!rs)
return false;

View file

@ -2114,7 +2114,7 @@ namespace SourceGit.ViewModels
IsAutoFetching = true;
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));
new Commands.Fetch(_fullpath, "--all", true, false, null) { RaiseError = false }.Exec();
new Commands.Fetch(_fullpath, "--all", false, null) { RaiseError = false }.Exec();
_lastFetchTime = DateTime.Now;
IsAutoFetching = false;
Dispatcher.UIThread.Invoke(() => OnPropertyChanged(nameof(IsAutoFetching)));