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

Commita094ac1

Browse files
committed
add types to git.util and git.__init__
1 parent5b0028e commita094ac1

File tree

3 files changed

+68
-57
lines changed

3 files changed

+68
-57
lines changed

‎git/__init__.py

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,15 +8,18 @@
88
importinspect
99
importos
1010
importsys
11-
1211
importos.pathasosp
1312

13+
fromtypingimportOptional
14+
fromgit.typesimportPathLike
1415

1516
__version__='git'
1617

1718

19+
20+
1821
#{ Initialization
19-
def_init_externals():
22+
def_init_externals()->None:
2023
"""Initialize external projects by putting them into the path"""
2124
if__version__=='git'and'PYOXIDIZER'notinos.environ:
2225
sys.path.insert(1,osp.join(osp.dirname(__file__),'ext','gitdb'))
@@ -65,7 +68,7 @@ def _init_externals():
6568
#{ Initialize git executable path
6669
GIT_OK=None
6770

68-
defrefresh(path=None):
71+
defrefresh(path:Optional[PathLike]=None)->None:
6972
"""Convenience method for setting the git executable path."""
7073
globalGIT_OK
7174
GIT_OK=False

‎git/remote.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
TagReference
3535
)
3636

37+
# typing-------------------------------------------------------
38+
39+
fromgit.repo.BaseimportRepo
3740

3841
log=logging.getLogger('git.remote')
3942
log.addHandler(logging.NullHandler())
@@ -403,7 +406,7 @@ def __init__(self, repo, name):
403406
404407
:param repo: The repository we are a remote of
405408
:param name: the name of the remote, i.e. 'origin'"""
406-
self.repo=repo
409+
self.repo=repo# type: 'Repo'
407410
self.name=name
408411

409412
ifis_win:

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp