Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Change aliases to work around mypy issue.#1935

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
Byron merged 1 commit intogitpython-developers:mainfromPatrickMassot:main
Jun 24, 2024
Merged
Show file tree
Hide file tree
Changes fromall 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
11 changes: 9 additions & 2 deletionsgit/remote.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -828,8 +828,15 @@ def remove(cls, repo: "Repo", name: str) -> str:
name._clear_cache()
returnname

# `rm` is an alias.
rm=remove
@classmethod
defrm(cls,repo:"Repo",name:str)->str:
"""Alias of remove.
Remove the remote with the given name.
:return:
The passed remote name to remove
"""
returncls.remove(repo,name)

defrename(self,new_name:str)->"Remote":
"""Rename self to the given `new_name`.
Expand Down
24 changes: 20 additions & 4 deletionsgit/repo/base.py
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -402,6 +402,17 @@ def heads(self) -> "IterableList[Head]":
"""
return Head.list_items(self)

@property
def branches(self) -> "IterableList[Head]":
"""Alias for heads.
A list of :class:`~git.refs.head.Head` objects representing the branch heads
in this repo.

:return:
``git.IterableList(Head, ...)``
"""
return self.heads

@property
def references(self) -> "IterableList[Reference]":
"""A list of :class:`~git.refs.reference.Reference` objects representing tags,
Expand All@@ -412,11 +423,16 @@ def references(self) -> "IterableList[Reference]":
"""
return Reference.list_items(self)

# Alias for references.
refs = references
@property
def refs(self) -> "IterableList[Reference]":
"""Alias for references.
A list of :class:`~git.refs.reference.Reference` objects representing tags,
heads and remote references.

# Alias for heads.
branches = heads
:return:
``git.IterableList(Reference, ...)``
"""
return self.references

@property
def index(self) -> "IndexFile":
Expand Down
Loading

[8]ページ先頭

©2009-2025 Movatter.jp