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

Commitb00ad00

Browse files
committed
submodule: When adding an existing submodule, when retrieving the binsha, we will now consider not only the tree, but the index too
1 parent2ab454f commitb00ad00

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

‎lib/git/objects/submodule/base.py

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,15 @@ def add(cls, repo, name, path, url=None, branch=None, no_checkout=False):
215215
sm=cls(repo,cls.NULL_BIN_SHA,cls.k_default_mode,path,name)
216216
ifsm.exists():
217217
# reretrieve submodule from tree
218-
returnrepo.head.commit.tree[path]
218+
try:
219+
returnrepo.head.commit.tree[path]
220+
exceptKeyError:
221+
# could only be in index
222+
index=repo.index
223+
entry=index.entries[index.entry_key(path,0)]
224+
sm.binsha=entry.binsha
225+
returnsm
226+
# END handle exceptions
219227
# END handle existing
220228

221229
br=mkhead(repo,branchorcls.k_head_default)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp