From a594c2ac5944250774e61e2a08f5b489fc6a6cf6 Mon Sep 17 00:00:00 2001 From: MikaMika Date: Mon, 9 Mar 2026 12:45:45 +0100 Subject: [PATCH] Add Depth to Commands.Fetch Thanks to https://github.com/libgit2/libgit2sharp/pull/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. --- LibGit2Sharp/Commands/Fetch.cs | 1 + 1 file changed, 1 insertion(+) diff --git a/LibGit2Sharp/Commands/Fetch.cs b/LibGit2Sharp/Commands/Fetch.cs index e531aac51..269bdcf9f 100644 --- a/LibGit2Sharp/Commands/Fetch.cs +++ b/LibGit2Sharp/Commands/Fetch.cs @@ -54,6 +54,7 @@ public static void Fetch(Repository repository, string remote, IEnumerable