Merge pull request #1855 from EliahKagan/reference · gitpython-developers/GitPython@57de362 · GitHub
Skip to content

Commit 57de362

Browse files
authored
Merge pull request #1855 from EliahKagan/reference
Expand what is included in the API Reference
2 parents 7fbfc77 + c4a6618 commit 57de362

5 files changed

Lines changed: 60 additions & 24 deletions

File tree

doc/source/reference.rst

Lines changed: 45 additions & 18 deletions

git/cmd.py

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -389,7 +389,9 @@ def __setstate__(self, d: Dict[str, Any]) -> None:
389389

390390
@classmethod
391391
def refresh(cls, path: Union[None, PathLike] = None) -> bool:
392-
"""This gets called by the refresh function (see the top level ``__init__``).
392+
"""Update information about the git executable :class:`Git` objects will use.
393+
394+
Called by the :func:`git.refresh` function in the top level ``__init__``.
393395
394396
:param path:
395397
Optional path to the git executable. If not absolute, it is resolved
@@ -1486,7 +1488,9 @@ def _call_process(
14861488
def _parse_object_header(self, header_line: str) -> Tuple[str, str, int]:
14871489
"""
14881490
:param header_line:
1489-
<hex_sha> type_string size_as_int
1491+
A line of the form::
1492+
1493+
<hex_sha> type_string size_as_int
14901494
14911495
:return:
14921496
(hex_sha, type_string, size_as_int)
@@ -1576,7 +1580,7 @@ def get_object_data(self, ref: str) -> Tuple[str, str, int, bytes]:
15761580
return (hexsha, typename, size, data)
15771581

15781582
def stream_object_data(self, ref: str) -> Tuple[str, str, int, "Git.CatFileContentStream"]:
1579-
"""Similar to :meth:`get_object_header`, but returns the data as a stream.
1583+
"""Similar to :meth:`get_object_data`, but returns the data as a stream.
15801584
15811585
:return:
15821586
(hexsha, type_string, size_as_int, stream)

git/compat.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
6262
:note:
6363
For macOS (Darwin), ``os.name == "posix"`` as in other Unix-like systems, while
64-
``sys.platform == "darwin"`.
64+
``sys.platform == "darwin"``.
6565
"""
6666

6767
defenc = sys.getfilesystemencoding()

git/db.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,12 @@ def __init__(self, root_path: PathLike, git: "Git") -> None:
3838
self._git = git
3939

4040
def info(self, binsha: bytes) -> OInfo:
41+
"""Get a git object header (using git itself)."""
4142
hexsha, typename, size = self._git.get_object_header(bin_to_hex(binsha))
4243
return OInfo(hex_to_bin(hexsha), typename, size)
4344

4445
def stream(self, binsha: bytes) -> OStream:
45-
"""For now, all lookup is done by git itself"""
46+
"""Get git object data as a stream supporting ``read()`` (using git itself)."""
4647
hexsha, typename, size, stream = self._git.stream_object_data(bin_to_hex(binsha))
4748
return OStream(hex_to_bin(hexsha), typename, size, stream)
4849

git/remote.py

Lines changed: 5 additions & 1 deletion

0 commit comments

Comments
 (0)