@@ -847,7 +847,7 @@ vcsTestDriverGit
847
847
-> VCSTestDriver
848
848
vcsTestDriverGit verbosity vcs submoduleDir repoRoot =
849
849
VCSTestDriver
850
- { vcsVCS = vcs
850
+ { vcsVCS = vcs'
851
851
, vcsRepoRoot = repoRoot
852
852
, vcsIgnoreFiles = Set. empty
853
853
, vcsInit =
@@ -872,7 +872,7 @@ vcsTestDriverGit verbosity vcs submoduleDir repoRoot =
872
872
, vcsTagState = \ _ tagname ->
873
873
git [" tag" , " --force" , " --no-sign" , tagname]
874
874
, vcsSubmoduleDriver =
875
- pure . vcsTestDriverGit verbosity vcs submoduleDir . (submoduleDir </> )
875
+ pure . vcsTestDriverGit verbosity vcs' submoduleDir . (submoduleDir </> )
876
876
, vcsAddSubmodule = \ _ source dest -> do
877
877
destExists <-
878
878
(||)
@@ -897,8 +897,26 @@ vcsTestDriverGit verbosity vcs submoduleDir repoRoot =
897
897
updateSubmodulesAndCleanup
898
898
}
899
899
where
900
+ -- Git 2.38.1 and newer fails to clone from local paths with `fatal: transport 'file'
901
+ -- not allowed` unless `protocol.file.allow=always` is set.
902
+ --
903
+ -- This is not safe in general, but it's fine in the test suite.
904
+ --
905
+ -- See: https://github.blog/open-source/git/git-security-vulnerabilities-announced/#fn-67904-1
906
+ -- See: https://git-scm.com/docs/git-config#Documentation/git-config.txt-protocolallow
907
+ vcs' =
908
+ vcs
909
+ { vcsProgram =
910
+ (vcsProgram vcs)
911
+ { programDefaultArgs =
912
+ programDefaultArgs (vcsProgram vcs)
913
+ ++ [ " -c"
914
+ , " protocol.file.allow=always"
915
+ ]
916
+ }
917
+ }
900
918
gitInvocation args =
901
- (programInvocation (vcsProgram vcs) args)
919
+ (programInvocation (vcsProgram vcs' ) args)
902
920
{ progInvokeCwd = Just repoRoot
903
921
}
904
922
git = runProgramInvocation verbosity . gitInvocation
0 commit comments