Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions git/refs/head.py
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,7 @@ def rename(self, new_path: PathLike, force: bool = False) -> "Head":
:note:
Respects the ref log, as git commands are used.
"""
SymbolicReference._check_ref_name_valid(self.to_full_path(new_path))
flag = "-m"
if force:
flag = "-M"
Expand Down Expand Up @@ -273,6 +274,7 @@ def checkout(self, force: bool = False, **kwargs: Any) -> Union["HEAD", "Head"]:

# { Configuration
def _config_parser(self, read_only: bool) -> SectionConstraint[GitConfigParser]:
SymbolicReference._check_ref_name_valid(self.path)
if read_only:
parser = self.repo.config_reader()
else:
Expand Down