MCPcopy Create free account
hub / github.com/commitizen-tools/commitizen / get_filenames_in_commit

Function get_filenames_in_commit

commitizen/git.py:224–237  ·  view source on GitHub ↗

Get the list of files that were committed in the requested git reference. :param git_reference: a git reference as accepted by `git show`, default: the last commit :returns: file names committed in the last commit by default or inside the passed git reference

(git_reference: str = "")

Source from the content-addressed store, hash-verified

222
223
224def get_filenames_in_commit(git_reference: str = "") -> list[str]:
225 """Get the list of files that were committed in the requested git reference.
226
227 :param git_reference: a git reference as accepted by `git show`, default: the last commit
228
229 :returns: file names committed in the last commit by default or inside the passed git reference
230 """
231 cmd_args = ["git", "show", "--name-only", "--pretty=format:"]
232 if git_reference:
233 cmd_args.append(git_reference)
234 c = cmd.run(cmd_args)
235 if c.return_code == 0:
236 return c.out.strip().split("\n")
237 raise GitCommandError(c.err)
238
239
240def get_tags(

Callers

nothing calls this directly

Calls 1

GitCommandErrorClass · 0.90

Tested by

no test coverage detected