From fd1f37f8d1c6c92e0cbd36d9294a93e41999a835 Mon Sep 17 00:00:00 2001 From: Chris Penner Date: Fri, 11 Feb 2022 10:32:51 -0600 Subject: [PATCH] Use shallow clones for pull --- parser-typechecker/src/Unison/Codebase/Editor/Git.hs | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/parser-typechecker/src/Unison/Codebase/Editor/Git.hs b/parser-typechecker/src/Unison/Codebase/Editor/Git.hs index 6ac22e2dbc..e6398a93fc 100644 --- a/parser-typechecker/src/Unison/Codebase/Editor/Git.hs +++ b/parser-typechecker/src/Unison/Codebase/Editor/Git.hs @@ -193,10 +193,7 @@ withRepo repo@(ReadGitRepo {url = uri, ref = mayGitRef}) branchBehavior action = "--force", -- force updating local refs even if not fast-forward -- update local refs with the same name they have on the remote. "--refmap", "*:*", - -- Note: a shallow fetch saves time initially, but prevents - -- 'local' clones from using hard-links, so doing a normal fetch saves the most time - -- in the long run. - -- "--depth", "1", + "--depth", "1", uri, -- The repo to fetch from gitRef -- The specific reference to fetch ] ++ gitVerbosity @@ -221,10 +218,7 @@ cloneIfMissing repo@(ReadGitRepo {url=uri}) localPath = do gitGlobal (["clone"] ++ ["--bare"] - -- Note: a shallow clone saves time on the initial clone, but prevents all future - -- 'local' clones from using hard-links, so doing a full clone saves the most time - -- in the long run. - -- ++ ["--depth", "1"] + ++ ["--depth", "1"] ++ [uri, Text.pack localPath])) `withIOError` (throwError . GitError.CloneException repo . show) isGitDir <- liftIO $ isGitRepo (Bare localPath)