Skip to content
Merged
Show file tree
Hide file tree
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: 1 addition & 1 deletion git/refs/head.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -129,7 +129,7 @@ class Head(Reference):
k_config_remote_ref="merge"# branch to merge from remote

@classmethod
defdelete(cls, repo: 'Repo', *heads: 'Head', force: bool=False, **kwargs: Any) ->None:
defdelete(cls, repo: 'Repo', *heads: 'Union[Head, str]', force: bool=False, **kwargs: Any) ->None:
"""Delete the given heads
:param force:
Expand Down
7 changes: 6 additions & 1 deletion git/refs/remote.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -37,8 +37,13 @@ def iter_items(cls, repo: 'Repo', common_path: Union[PathLike, None] = None,
# super is Reference
returnsuper(RemoteReference, cls).iter_items(repo, common_path)

# The Head implementation of delete also accepts strs, but this
# implementation does not. mypy doesn't have a way of representing
# tightening the types of arguments in subclasses and recommends Any or
# "type: ignore". (See https://github.com/python/typing/issues/241)
@ classmethod
defdelete(cls, repo: 'Repo', *refs: 'RemoteReference', **kwargs: Any) ->None:
defdelete(cls, repo: 'Repo', *refs: 'RemoteReference', # type: ignore
**kwargs: Any) ->None:
"""Delete the given remote references
:note:
Expand Down
4 changes: 3 additions & 1 deletion git/remote.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -665,7 +665,9 @@ def create(cls, repo: 'Repo', name: str, url: str, **kwargs: Any) -> 'Remote':
returncls(repo, name)

# add is an alias
add=create
@ classmethod
defadd(cls, repo: 'Repo', name: str, url: str, **kwargs: Any) ->'Remote':
returncls.create(repo, name, url, **kwargs)

@ classmethod
defremove(cls, repo: 'Repo', name: str) ->str:
Expand Down
2 changes: 1 addition & 1 deletion git/repo/base.py
Original file line numberDiff line numberDiff line change
Expand Up@@ -429,7 +429,7 @@ def create_head(self, path: PathLike, commit: str = 'HEAD',
:return: newly created Head Reference"""
returnHead.create(self, path, commit, logmsg, force)

defdelete_head(self, *heads: 'Head', **kwargs: Any) ->None:
defdelete_head(self, *heads: 'Union[str, Head]', **kwargs: Any) ->None:
"""Delete the given heads
:param kwargs: Additional keyword arguments to be passed to git-branch"""
Expand Down