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

Commitef32490

Browse files
authored
Merge pull request#1305 from gitpython-developers/typing
Improve types of objects/
2 parents37fa31d +a5a05d1 commitef32490

File tree

3 files changed

+7
-6
lines changed

3 files changed

+7
-6
lines changed

‎git/objects/commit.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@ def __init__(self, repo: 'Repo', binsha: bytes, tree: Union[Tree, None] = None,
128128
as what time.altzone returns. The sign is inverted compared to git's
129129
UTC timezone."""
130130
super(Commit,self).__init__(repo,binsha)
131+
self.binsha=binsha
131132
iftreeisnotNone:
132133
assertisinstance(tree,Tree),"Tree needs to be a Tree instance, was %s"%type(tree)
133134
iftreeisnotNone:

‎git/objects/submodule/base.py

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -563,6 +563,7 @@ def update(self, recursive: bool = False, init: bool = True, to_latest_revision:
563563
progress.update(op,i,len_rmts,prefix+"Done fetching remote of submodule %r"%self.name)
564564
# END fetch new data
565565
exceptInvalidGitRepositoryError:
566+
mrepo=None
566567
ifnotinit:
567568
returnself
568569
# END early abort if init is not allowed
@@ -603,7 +604,7 @@ def update(self, recursive: bool = False, init: bool = True, to_latest_revision:
603604

604605
# make sure HEAD is not detached
605606
mrepo.head.set_reference(local_branch,logmsg="submodule: attaching head to %s"%local_branch)
606-
mrepo.head.ref.set_tracking_branch(remote_branch)
607+
mrepo.head.reference.set_tracking_branch(remote_branch)
607608
except (IndexError,InvalidGitRepositoryError):
608609
log.warning("Failed to checkout tracking branch %s",self.branch_path)
609610
# END handle tracking branch
@@ -629,13 +630,14 @@ def update(self, recursive: bool = False, init: bool = True, to_latest_revision:
629630
ifmrepoisnotNoneandto_latest_revision:
630631
msg_base="Cannot update to latest revision in repository at %r as "%mrepo.working_dir
631632
ifnotis_detached:
632-
rref=mrepo.head.ref.tracking_branch()
633+
rref=mrepo.head.reference.tracking_branch()
633634
ifrrefisnotNone:
634635
rcommit=rref.commit
635636
binsha=rcommit.binsha
636637
hexsha=rcommit.hexsha
637638
else:
638-
log.error("%s a tracking branch was not set for local branch '%s'",msg_base,mrepo.head.ref)
639+
log.error("%s a tracking branch was not set for local branch '%s'",
640+
msg_base,mrepo.head.reference)
639641
# END handle remote ref
640642
else:
641643
log.error("%s there was no local tracking branch",msg_base)

‎git/objects/submodule/root.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,7 @@
22
Submodule,
33
UpdateProgress
44
)
5-
from .utilimport (
6-
find_first_remote_branch
7-
)
5+
from .utilimportfind_first_remote_branch
86
fromgit.excimportInvalidGitRepositoryError
97
importgit
108

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp