From e263c0dd0fd4710c3a88b5a6ad1e9c49592fb557 Mon Sep 17 00:00:00 2001 From: Rob Rix Date: Sun, 28 Feb 2016 10:20:52 -0500 Subject: [PATCH] cloneAndExtract takes clone arguments. Add the arguments to the list. Note recursive clones in the changelog. Remove leading comma. Parenthesize. Format across lines. --- ChangeLog.md | 3 +++ src/Stack/Config.hs | 13 +++++++------ 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/ChangeLog.md b/ChangeLog.md index d413827320..bfb31d45eb 100644 --- a/ChangeLog.md +++ b/ChangeLog.md @@ -8,6 +8,9 @@ Major changes: Other enhancements: +* `git` packages with submodules are supported by passing the `--recursive` + flag to `git clone`. + Bug fixes: ## 1.0.4 diff --git a/src/Stack/Config.hs b/src/Stack/Config.hs index 6c8994ba33..292c754f86 100644 --- a/src/Stack/Config.hs +++ b/src/Stack/Config.hs @@ -576,13 +576,14 @@ resolvePackageLocation menv projRoot (PLRemote url remotePackageType) = do unless exists $ do ignoringAbsence (removeDirRecur dirTmp) - let cloneAndExtract commandName resetCommand commit = do + let cloneAndExtract commandName cloneArgs resetCommand commit = do ensureDir (parent dirTmp) readInNull (parent dirTmp) commandName menv - [ "clone" - , T.unpack url + ("clone" : + cloneArgs ++ + [ T.unpack url , toFilePathNoTrailingSep dirTmp - ] + ]) Nothing readInNull dirTmp commandName menv (resetCommand ++ [T.unpack commit]) @@ -615,8 +616,8 @@ resolvePackageLocation menv projRoot (PLRemote url remotePackageType) = do tryTar `catchAllLog` tryZip `catchAllLog` err - RPTGit commit -> cloneAndExtract "git" ["reset", "--hard"] commit - RPTHg commit -> cloneAndExtract "hg" ["update", "-C"] commit + RPTGit commit -> cloneAndExtract "git" ["--recursive"] ["reset", "--hard"] commit + RPTHg commit -> cloneAndExtract "hg" [] ["update", "-C"] commit renameDir dirTmp dir