MCPcopy
hub / github.com/GitGuardian/ggshield / get_diff_files

Function get_diff_files

ggshield/core/scan/commit_utils.py:398–403  ·  view source on GitHub ↗

Helper function to get the files modified and staged.

(cwd: Optional[Path] = None)

Source from the content-addressed store, hash-verified

396
397
398def get_diff_files(cwd: Optional[Path] = None) -> List[str]:
399 """
400 Helper function to get the files modified and staged.
401 """
402 output = git(["diff", "--name-only", "--staged", "-z"], cwd=cwd)
403 return output.split("\0")[:-1] # remove the trailing \0

Callers 1

from_mergeMethod · 0.85

Calls 1

gitFunction · 0.90

Tested by

no test coverage detected