File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change 2424
2525
2626@click .command ()
27+ @click .option ("--no-mirror" , is_flag = True , default = False ,
28+ help = "Don't clone with git --mirror" )
2729@click .argument ("repository" , nargs = 1 , type = click .STRING , required = True )
2830@add_secret_scan_common_options ()
2931@click .pass_context
3032def repo_cmd (
31- ctx : click .Context , repository : str , ** kwargs : Any
33+ ctx : click .Context , repository : str , no_mirror : bool , ** kwargs : Any
3234) -> int : # pragma: no cover
3335 """
3436 Scan a REPOSITORY's commits at the given URL or path.
@@ -60,7 +62,10 @@ def repo_cmd(
6062
6163 if REGEX_GIT_URL .match (repository ):
6264 with tempfile .TemporaryDirectory () as tmpdirname :
63- git (["clone" , repository , tmpdirname ])
65+ git_arguments = ["clone" , "--mirror" , repository , tmpdirname ]
66+ if no_mirror :
67+ git_arguments .remove ("--mirror" )
68+ git (git_arguments )
6469 scan_context .target_path = Path (tmpdirname )
6570 return scan_repo_path (
6671 client = client ,
You can’t perform that action at this time.
0 commit comments