diff options
author | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2020-09-05 21:13:40 +0200 |
---|---|---|
committer | Sebastian Ehlert <28669218+awvwgk@users.noreply.github.com> | 2020-09-05 21:13:40 +0200 |
commit | 7bdde90b1fa1c377bd2b50ec16ff1437965962c5 (patch) | |
tree | 072458fd6cbe9e869e0d88d686492f27803b114e /bootstrap/src/Fpm.hs | |
parent | cd10478e26c428e599a1cecc99b03b6b0c1292d3 (diff) | |
download | fpm-7bdde90b1fa1c377bd2b50ec16ff1437965962c5.tar.gz fpm-7bdde90b1fa1c377bd2b50ec16ff1437965962c5.zip |
Use different strategy to fetch git dependencies
- use init -> fetch -> checkout -qf instead of current clone [-> checkout] strategy
Diffstat (limited to 'bootstrap/src/Fpm.hs')
-rw-r--r-- | bootstrap/src/Fpm.hs | 14 |
1 files changed, 9 insertions, 5 deletions
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) {- |