Skip to content

Commit 9dc7fb0

Browse files
committed
Fix _index_from_*_format docstrings (proc reading)
In the git.diff.Diff class, the _index_from_patch_format and _index_from_raw_format methods' docstrings had still described them as reading from streams, even though they have instead read from processes (and taken "proc", not "stream", arguments) since gitpython-developers#519 when the change was made in a5db3d3 to fix a freezing bug. This updates the docstrings to reflect that they read from processes.
1 parent 072f0d8 commit 9dc7fb0

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

git/diff.py

+12-6
Original file line numberDiff line numberDiff line change
@@ -486,10 +486,12 @@ def _pick_best_path(cls, path_match: bytes, rename_match: bytes, path_fallback_m
486486

487487
@classmethod
488488
def _index_from_patch_format(cls, repo: "Repo", proc: Union["Popen", "Git.AutoInterrupt"]) -> DiffIndex:
489-
"""Create a new DiffIndex from the given text which must be in patch format
490-
:param repo: is the repository we are operating on - it is required
491-
:param stream: result of 'git diff' as a stream (supporting file protocol)
492-
:return: git.DiffIndex"""
489+
"""Create a new DiffIndex from the given process output which must be in patch format.
490+
491+
:param repo: The repository we are operating on
492+
:param proc: ``git diff`` process to read from (supports :class:`Git.AutoInterrupt` wrapper)
493+
:return: git.DiffIndex
494+
"""
493495

494496
## FIXME: Here SLURPING raw, need to re-phrase header-regexes linewise.
495497
text_list: List[bytes] = []
@@ -644,8 +646,12 @@ def _handle_diff_line(lines_bytes: bytes, repo: "Repo", index: DiffIndex) -> Non
644646

645647
@classmethod
646648
def _index_from_raw_format(cls, repo: "Repo", proc: "Popen") -> "DiffIndex":
647-
"""Create a new DiffIndex from the given stream which must be in raw format.
648-
:return: git.DiffIndex"""
649+
"""Create a new DiffIndex from the given process output which must be in raw format.
650+
651+
:param repo: The repository we are operating on
652+
:param proc: Process to read output from
653+
:return: git.DiffIndex
654+
"""
649655
# handles
650656
# :100644 100644 687099101... 37c5e30c8... M .gitignore
651657

0 commit comments

Comments
 (0)