Skip to content

Commit 36a3b76

Browse files
committed
Revise some comments and strings
These are a few things I had missed in gitpython-developers#1725.
1 parent 6cef9c0 commit 36a3b76

File tree

3 files changed

+6
-5
lines changed

3 files changed

+6
-5
lines changed

Diff for: git/config.py

+1
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,7 @@ class SectionConstraint(Generic[T_ConfigParser]):
150150
"""
151151

152152
__slots__ = ("_config", "_section_name")
153+
153154
_valid_attrs_ = (
154155
"get_value",
155156
"set_value",

Diff for: git/objects/base.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -137,7 +137,7 @@ def __repr__(self) -> str:
137137
@property
138138
def hexsha(self) -> str:
139139
""":return: 40 byte hex version of our 20 byte binary sha"""
140-
# b2a_hex produces bytes
140+
# b2a_hex produces bytes.
141141
return bin_to_hex(self.binsha).decode("ascii")
142142

143143
@property
@@ -206,7 +206,7 @@ def __hash__(self) -> int:
206206

207207
def _set_cache_(self, attr: str) -> None:
208208
if attr in IndexObject.__slots__:
209-
# they cannot be retrieved lateron ( not without searching for them )
209+
# They cannot be retrieved later on (not without searching for them).
210210
raise AttributeError(
211211
"Attribute '%s' unset: path and mode attributes must have been set during %s object creation"
212212
% (attr, type(self).__name__)

Diff for: git/refs/symbolic.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ def _check_ref_name_valid(ref_path: PathLike) -> None:
215215
elif any(component.endswith(".lock") for component in str(ref_path).split("/")):
216216
raise ValueError(
217217
f"Invalid reference '{ref_path}': references cannot have slash-separated components that end with"
218-
f" '.lock'"
218+
" '.lock'"
219219
)
220220

221221
@classmethod
@@ -309,8 +309,8 @@ def set_commit(
309309
) -> "SymbolicReference":
310310
"""As set_object, but restricts the type of object to be a Commit.
311311
312-
:raise ValueError: If commit is not a Commit object or doesn't point to
313-
a commit
312+
:raise ValueError: If commit is not a :class:`~git.objects.commit.Commit` object
313+
or doesn't point to a commit
314314
:return: self
315315
"""
316316
# Check the type - assume the best if it is a base-string.

0 commit comments

Comments
 (0)