diff options
author | Milan Curcic <caomaco@gmail.com> | 2020-09-15 14:50:48 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-09-15 14:50:48 -0400 |
commit | f641aae7dc6e8b7fdcb926e1181b62665f827854 (patch) | |
tree | 2b2e2efbe2477bf84a69adb1df735ceaa29e743a /bootstrap/src | |
parent | e6f87856b4346eb5300b49b10cb6be5215aa9bf9 (diff) | |
parent | 7bdde90b1fa1c377bd2b50ec16ff1437965962c5 (diff) | |
download | fpm-f641aae7dc6e8b7fdcb926e1181b62665f827854.tar.gz fpm-f641aae7dc6e8b7fdcb926e1181b62665f827854.zip |
Merge pull request #163 from awvwgk/fetch
Use different strategy to fetch git dependencies
Diffstat (limited to 'bootstrap/src')
-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) {- |