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

Commit4f13b4e

Browse files
committed
fix base,ours,theirs typing
1 parentc27d2b0 commit4f13b4e

File tree

3 files changed

+9
-9
lines changed

3 files changed

+9
-9
lines changed

‎git/index/fun.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -386,13 +386,13 @@ def aggressive_tree_merge(odb, tree_shas: Sequence[bytes]) -> List[BaseIndexEntr
386386
# END handle ours
387387
else:
388388
# all three can't be None
389-
ifoursisNoneandtheirsisnotNone:
389+
ifoursisNone:
390390
# added in their branch
391-
out.append(_tree_entry_to_baseindexentry(theirs,0))
392-
eliftheirsisNoneandoursisnotNone:
391+
out.append(_tree_entry_to_baseindexentry(theirs,0))# type: ignore
392+
eliftheirsisNone:#ours is not None, theirs is None
393393
# added in our branch
394394
out.append(_tree_entry_to_baseindexentry(ours,0))
395-
elifoursisnotNoneandtheirsisnotNone:
395+
else:
396396
# both have it, except for the base, see whether it changed
397397
ifours[0]!=theirs[0]orours[1]!=theirs[1]:
398398
out.append(_tree_entry_to_baseindexentry(ours,2))

‎git/objects/fun.py‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,13 @@ def tree_entries_from_data(data: bytes) -> List[EntryTup]:
102102
returnout
103103

104104

105-
def_find_by_name(tree_data:Sequence[EntryTupOrNone],name:str,is_dir:bool,start_at:int
105+
def_find_by_name(tree_data:List[EntryTupOrNone],name:str,is_dir:bool,start_at:int
106106
)->EntryTupOrNone:
107107
"""return data entry matching the given name and tree mode
108108
or None.
109109
Before the item is returned, the respective data item is set
110110
None in the tree_data list to mark it done"""
111-
tree_data_list:List[EntryTupOrNone]=list(tree_data)
111+
tree_data_list:List[EntryTupOrNone]=tree_data
112112
try:
113113
item=tree_data_list[start_at]
114114
ifitemanditem[2]==nameandS_ISDIR(item[1])==is_dir:
@@ -160,6 +160,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by
160160
set it '' for the first iteration
161161
:note: The ordering of the returned items will be partially lost"""
162162
trees_data:List[List[EntryTupOrNone]]= []
163+
163164
nt=len(tree_shas)
164165
fortree_shaintree_shas:
165166
iftree_shaisNone:
@@ -193,8 +194,7 @@ def traverse_trees_recursive(odb: 'GitCmdObjectDB', tree_shas: Sequence[Union[by
193194
# ti+nt, not ti+1+nt
194195
fortioinrange(ti+1,ti+nt):
195196
tio=tio%nt
196-
td=trees_data[tio]
197-
entries[tio]=_find_by_name(td,name,is_dir,ii)
197+
entries[tio]=_find_by_name(trees_data[tio],name,is_dir,ii)
198198

199199
# END for each other item data
200200
# if we are a directory, enter recursion

‎git/objects/tree.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@
4444

4545
defgit_cmp(t1:TreeCacheTup,t2:TreeCacheTup)->int:
4646
a,b=t1[2],t2[2]
47-
assertisinstance(a,str)andisinstance(b,str)# Need as mypy 9.0 cannot unpack TypeVar properly
47+
#assert isinstance(a, str) and isinstance(b, str)
4848
len_a,len_b=len(a),len(b)
4949
min_len=min(len_a,len_b)
5050
min_cmp=cmp(a[:min_len],b[:min_len])

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2026 Movatter.jp