git_interface.show

Methods for using the ‘show’ command

async git_interface.show.show_file(git_repo, tree_ish, file_path)

Read a file from a repository

param git_repo

Path to the repo

param tree_ish

The tree ish (branch name, HEAD)

param file_path

The file in the repo to read

raises UnknownRevisionException

Unknown tree_ish

raises PathDoesNotExistInRevException

File not found in repo

raises GitException

Error to do with git

return

The read file

Parameters
  • git_repo (Union[Path, str]) –

  • tree_ish (str) –

  • file_path (str) –

Return type

Coroutine[Any, Any, bytes]

async git_interface.show.show_file_buffered(git_repo, tree_ish, file_path)

Read a file from a repository, but using a buffered read

param git_repo

Path to the repo

param tree_ish

The tree ish (branch name, HEAD)

param file_path

The file in the repo to read

raises UnknownRevisionException

Unknown tree_ish

raises PathDoesNotExistInRevException

File not found in repo

raises GitException

Error to do with git

yield

Each read file section

Parameters
  • git_repo (Union[Path, str]) –

  • tree_ish (str) –

  • file_path (str) –

Return type

AsyncGenerator[bytes, None, None]