Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
13 changes: 7 additions & 6 deletions src/Stack/Config.hs
Original file line number Diff line number Diff line change
Expand Up @@ -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])
Expand Down Expand Up @@ -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

Expand Down