Skip to content

Commit

Permalink
Revise some comments and strings
Browse files Browse the repository at this point in the history
These are a few things I had missed in #1725.
  • Loading branch information
EliahKagan committed Nov 2, 2023
1 parent 6cef9c0 commit 36a3b76
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 5 deletions.
1 change: 1 addition & 0 deletions git/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ class SectionConstraint(Generic[T_ConfigParser]):
"""

__slots__ = ("_config", "_section_name")

_valid_attrs_ = (
"get_value",
"set_value",
Expand Down
4 changes: 2 additions & 2 deletions git/objects/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ def __repr__(self) -> str:
@property
def hexsha(self) -> str:
""":return: 40 byte hex version of our 20 byte binary sha"""
# b2a_hex produces bytes
# b2a_hex produces bytes.
return bin_to_hex(self.binsha).decode("ascii")

@property
Expand Down Expand Up @@ -206,7 +206,7 @@ def __hash__(self) -> int:

def _set_cache_(self, attr: str) -> None:
if attr in IndexObject.__slots__:
# they cannot be retrieved lateron ( not without searching for them )
# They cannot be retrieved later on (not without searching for them).
raise AttributeError(
"Attribute '%s' unset: path and mode attributes must have been set during %s object creation"
% (attr, type(self).__name__)
Expand Down
6 changes: 3 additions & 3 deletions git/refs/symbolic.py
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,7 @@ def _check_ref_name_valid(ref_path: PathLike) -> None:
elif any(component.endswith(".lock") for component in str(ref_path).split("/")):
raise ValueError(
f"Invalid reference '{ref_path}': references cannot have slash-separated components that end with"
f" '.lock'"
" '.lock'"
)

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

0 comments on commit 36a3b76

Please sign in to comment.