Skip to content

Commit 42b8a1c

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 21cc8ca commit 42b8a1c

File tree

1 file changed

+12
-6
lines changed

1 file changed

+12
-6
lines changed

git/diff.py

Lines changed: 12 additions & 6 deletions
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)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy