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
2 changes: 2 additions & 0 deletions ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,8 @@ Bug fixes:
* Fix `subdirs` for git repos in `extra-deps` to match whole directory names.
Also fixes for `subdirs: .`. See
[#4292](https://github.com/commercialhaskell/stack/issues/4292)
* Fix for git packages to update submodules to the correct state. See
[#4314](https://github.com/commercialhaskell/stack/pull/4314)
* Add `--cabal-files` flag to `stack ide targets` command.


Expand Down
18 changes: 9 additions & 9 deletions subs/pantry/src/Pantry/Repo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -71,26 +71,25 @@ getRepo' repo@(Repo url commit repoType' subdir) pm =
dir = tmpdir </> suffix
tarball = tmpdir </> "foo.tar"

let (commandName, cloneArgs, resetArgs, archiveArgs) =
let (commandName, resetArgs, submoduleArgs, archiveArgs) =
case repoType' of
RepoGit ->
( "git"
, ["--recursive"]
, ["reset", "--hard", T.unpack commit]
, Just ["submodule", "update", "--init", "--recursive"]
, ["archive", "-o", tarball, "HEAD"]
)
RepoHg ->
( "hg"
, []
, ["update", "-C", T.unpack commit]
, Nothing
, ["archive", tarball, "-X", ".hg_archival.txt"]
)

let runCommand args = void $ proc commandName args readProcess_

logInfo $ "Cloning " <> display commit <> " from " <> display url
void $ proc
commandName
("clone" : cloneArgs ++ [T.unpack url, suffix])
readProcess_
runCommand ("clone" : [T.unpack url, suffix])
-- On Windows 10, an upstream issue with the `git clone` command means that
-- command clears, but does not then restore, the
-- ENABLE_VIRTUAL_TERMINAL_PROCESSING flag for native terminals. The
Expand All @@ -100,8 +99,9 @@ getRepo' repo@(Repo url commit repoType' subdir) pm =
unless created $ throwIO $ FailedToCloneRepo repo

withWorkingDir dir $ do
void $ proc commandName resetArgs readProcess_
void $ proc commandName archiveArgs readProcess_
runCommand resetArgs
traverse_ runCommand submoduleArgs
runCommand archiveArgs
abs' <- resolveFile' tarball
getArchive
(PLIRepo repo pm)
Expand Down