MCPcopy Create free account
hub / github.com/blacklanternsecurity/bbot / git_checkout

Method git_checkout

bbot/modules/gitdumper.py:274–282  ·  view source on GitHub ↗
(self, folder)

Source from the content-addressed store, hash-verified

272 return output.stdout
273
274 async def git_checkout(self, folder):
275 self.helpers.sanitize_git_repo(folder)
276 self.verbose(f"Running git checkout to reconstruct the git repository at {folder}")
277 command = ["git"] + self._safe_git_flags + ["checkout", "HEAD", "--", "."]
278 try:
279 await self.run_process(command, env={"GIT_TERMINAL_PROMPT": "0"}, cwd=folder, check=True)
280 except CalledProcessError as e:
281 self.debug(f"Error running git checkout in {folder}. STDERR: {repr(e.stderr)}")
282 self._write_empty_index(folder)
283
284 @staticmethod
285 def _write_empty_index(folder):

Callers 1

handle_eventMethod · 0.95

Calls 4

_write_empty_indexMethod · 0.95
run_processMethod · 0.80
verboseMethod · 0.45
debugMethod · 0.45

Tested by

no test coverage detected