summaryrefslogtreecommitdiff
path: root/git/objects
diff options
context:
space:
mode:
Diffstat (limited to 'git/objects')
-rw-r--r--git/objects/base.py1
-rw-r--r--git/objects/fun.py2
-rw-r--r--git/objects/tree.py4
-rw-r--r--git/objects/util.py1
4 files changed, 7 insertions, 1 deletions
diff --git a/git/objects/base.py b/git/objects/base.py
index 9d005725..eb9a8ac3 100644
--- a/git/objects/base.py
+++ b/git/objects/base.py
@@ -143,6 +143,7 @@ class Object(LazyMixin):
def stream_data(self, ostream: "OStream") -> "Object":
"""Writes our data directly to the given output stream
+
:param ostream: File object compatible stream object.
:return: self"""
istream = self.repo.odb.stream(self.binsha)
diff --git a/git/objects/fun.py b/git/objects/fun.py
index 001e10e4..e91403a8 100644
--- a/git/objects/fun.py
+++ b/git/objects/fun.py
@@ -37,6 +37,7 @@ __all__ = (
def tree_to_stream(entries: Sequence[EntryTup], write: Callable[["ReadableBuffer"], Union[int, None]]) -> None:
"""Write the give list of entries into a stream using its write method
+
:param entries: **sorted** list of tuples with (binsha, mode, name)
:param write: write method which takes a data string"""
ord_zero = ord("0")
@@ -68,6 +69,7 @@ def tree_to_stream(entries: Sequence[EntryTup], write: Callable[["ReadableBuffer
def tree_entries_from_data(data: bytes) -> List[EntryTup]:
"""Reads the binary representation of a tree and returns tuples of Tree items
+
:param data: data block with tree data (as bytes)
:return: list(tuple(binsha, mode, tree_relative_path), ...)"""
ord_zero = ord("0")
diff --git a/git/objects/tree.py b/git/objects/tree.py
index b72e88c4..a9b491e2 100644
--- a/git/objects/tree.py
+++ b/git/objects/tree.py
@@ -128,6 +128,7 @@ class TreeModifier(object):
"""Call this method once you are done modifying the tree information.
It may be called several times, but be aware that each call will cause
a sort operation
+
:return self:"""
merge_sort(self._cache, git_cmp)
return self
@@ -175,6 +176,7 @@ class TreeModifier(object):
"""Add the given item to the tree, its correctness is assumed, which
puts the caller into responsibility to assure the input is correct.
For more information on the parameters, see ``add``
+
:param binsha: 20 byte binary sha"""
assert isinstance(binsha, bytes) and isinstance(mode, int) and isinstance(name, str)
tree_cache = (binsha, mode, name)
@@ -259,8 +261,8 @@ class Tree(IndexObject, git_diff.Diffable, util.Traversable, util.Serializable):
def join(self, file: str) -> IndexObjUnion:
"""Find the named object in this tree's contents
- :return: ``git.Blob`` or ``git.Tree`` or ``git.Submodule``
+ :return: ``git.Blob`` or ``git.Tree`` or ``git.Submodule``
:raise KeyError: if given file or tree does not exist in tree"""
msg = "Blob or Tree named %r not found"
if "/" in file:
diff --git a/git/objects/util.py b/git/objects/util.py
index 636a5831..f405d628 100644
--- a/git/objects/util.py
+++ b/git/objects/util.py
@@ -140,6 +140,7 @@ def utctz_to_altz(utctz: str) -> int:
"""we convert utctz to the timezone in seconds, it is the format time.altzone
returns. Git stores it as UTC timezone which has the opposite sign as well,
which explains the -1 * ( that was made explicit here )
+
:param utctz: git utc timezone string, i.e. +0200"""
return -1 * int(float(utctz) / 100 * 3600)