diff --git a/cabal-install/src/Distribution/Client/VCS.hs b/cabal-install/src/Distribution/Client/VCS.hs index 49addef110c..2f30c5e502a 100644 --- a/cabal-install/src/Distribution/Client/VCS.hs +++ b/cabal-install/src/Distribution/Client/VCS.hs @@ -384,7 +384,7 @@ vcsGit = Just peerLocalDir -> ["--reference", peerLocalDir] ++ verboseArg where loc = srpLocation - checkoutArgs = "checkout" : verboseArg ++ ["--detach", "--force" + checkoutArgs = "checkout" : verboseArg ++ ["--force" , checkoutTarget, "--" ] checkoutTarget = fromMaybe "HEAD" (srpBranch `mplus` srpTag) verboseArg = [ "--quiet" | verbosity < Verbosity.normal ]