From 7bdde90b1fa1c377bd2b50ec16ff1437965962c5 Mon Sep 17 00:00:00 2001 From: Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> Date: Sat, 5 Sep 2020 21:13:40 +0200 Subject: Use different strategy to fetch git dependencies - use init -> fetch -> checkout -qf instead of current clone [-> checkout] strategy --- bootstrap/src/Fpm.hs | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) (limited to 'bootstrap/src/Fpm.hs') diff --git a/bootstrap/src/Fpm.hs b/bootstrap/src/Fpm.hs index fdd83d9..d9de668 100644 --- a/bootstrap/src/Fpm.hs +++ b/bootstrap/src/Fpm.hs @@ -617,19 +617,23 @@ fetchDependency name version = do undefined GitVersion versionSpec -> do system - ("git clone " ++ gitVersionSpecUrl versionSpec ++ " " ++ clonePath) + ("git init " ++ clonePath) case gitVersionSpecRef versionSpec of - Just ref -> withCurrentDirectory clonePath $ do + Just ref -> do system - ( "git checkout " + ("git -C " ++ clonePath ++ " fetch " ++ gitVersionSpecUrl versionSpec ++ " " ++ (case ref of Tag tag -> tag Branch branch -> branch Commit commit -> commit ) ) - return (name, clonePath) - Nothing -> return (name, clonePath) + Nothing -> do + system + ("git -C " ++ clonePath ++ " fetch " ++ gitVersionSpecUrl versionSpec) + system + ("git -C " ++ clonePath ++ " checkout -qf FETCH_HEAD") + return (name, clonePath) PathVersion versionSpec -> return (name, pathVersionSpecPath versionSpec) {- -- cgit v1.2.3