Skip to content
This repository was archived by the owner on Jun 21, 2023. It is now read-only.

Commit 34539ea

Browse files
committed
Allow passing no refspecs to Fetch to use default
Fetch(Remote remote, FetchOptions options) was removed so we need a way to use the default refspec. This is done by passing an empty array of refspecs.
1 parent abd752f commit 34539ea

File tree

2 files changed

+1
-30
lines changed

2 files changed

+1
-30
lines changed

src/GitHub.App/Services/GitClient.cs

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -74,27 +74,6 @@ public Task Push(IRepository repository, string branchName, string remoteName)
7474
});
7575
}
7676

77-
public Task Fetch(IRepository repository, string remoteName)
78-
{
79-
Guard.ArgumentNotNull(repository, nameof(repository));
80-
Guard.ArgumentNotEmptyString(remoteName, nameof(remoteName));
81-
82-
return Task.Run(() =>
83-
{
84-
try
85-
{
86-
repository.Network.Fetch(remoteName, new[] { "+refs/heads/*:refs/remotes/origin/*" }, fetchOptions);
87-
}
88-
catch (Exception ex)
89-
{
90-
log.Error(ex, "Failed to fetch");
91-
#if DEBUG
92-
throw;
93-
#endif
94-
}
95-
});
96-
}
97-
9877
public Task Fetch(IRepository repo, UriString cloneUrl, params string[] refspecs)
9978
{
10079
foreach (var remote in repo.Network.Remotes)

src/GitHub.Exports.Reactive/Services/IGitClient.cs

Lines changed: 1 addition & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -25,20 +25,12 @@ public interface IGitClient
2525
/// <returns></returns>
2626
Task Push(IRepository repository, string branchName, string remoteName);
2727

28-
/// <summary>
29-
/// Fetches the remote.
30-
/// </summary>
31-
/// <param name="repository">The repository to pull</param>
32-
/// <param name="remoteName">The name of the remote</param>
33-
/// <returns></returns>
34-
Task Fetch(IRepository repository, string remoteName);
35-
3628
/// <summary>
3729
/// Fetches from the remote, using custom refspecs.
3830
/// </summary>
3931
/// <param name="repository">The repository to pull</param>
4032
/// <param name="remoteName">The name of the remote</param>
41-
/// <param name="refspecs">The custom refspecs</param>
33+
/// <param name="refspecs">The custom refspecs no none to use the default</param>
4234
/// <returns></returns>
4335
Task Fetch(IRepository repository, string remoteName, params string[] refspecs);
4436

0 commit comments

Comments
 (0)