Skip to content

Commit a594c2a

Browse files
authored
Add Depth to Commands.Fetch
Thanks to #2070, it is now possible to Clone with shallow depth. In some cases you'd want to unshallow. The current workaround is to delete the local repo and re-Clone with full depth. To avoid this un-necessary step, the Depth could be respected by Fetch, the same way it is doing it for Clone. This patch works for the cases I tested (don't forget to check `repo.Info.IsShallow`), but it seems too simple and I don't know what would be required to test and implement it properly. So I'd like to ask for help on this, thanks.
1 parent cb58177 commit a594c2a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

LibGit2Sharp/Commands/Fetch.cs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@ public static void Fetch(Repository repository, string remote, IEnumerable<strin
5454
var fetchOptions = fetchOptionsWrapper.Options;
5555
fetchOptions.RemoteCallbacks = gitCallbacks;
5656
fetchOptions.download_tags = Proxy.git_remote_autotag(remoteHandle);
57+
fetchOptions.Depth = options.Depth;
5758

5859
if (options.TagFetchMode.HasValue)
5960
{

0 commit comments

Comments
 (0)