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

Commitb4b6e1e

Browse files
committed
Fix IndexFile.commitparent_commits annotation
This changes that parameter's annotation to be equivalent to theannotation of the corresponding Commit.create_from_tree parameter.It had been annotated as the old Commit_ish type, but it passesthat argument to Commit.create_from_tree, and it also refers tothat method in its docstring for usage. Commit.create_from_treeannotates this argument as an optional list of Commit objects, andif the objects obtained when it iterates them are not Commitinstances, then an exception is raised. Even if being able to passother commit-ish things (or references, strings, etc.) isdesirable, that does not currently work.This also improves sorting (and grouping style) of imports in thatfile (which were being changed already to no longer import the oldCommit_ish type).
1 parentab27827 commitb4b6e1e

File tree

1 file changed

+15
-28
lines changed

1 file changed

+15
-28
lines changed

‎git/index/base.py

Lines changed: 15 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -11,23 +11,16 @@
1111
importglob
1212
fromioimportBytesIO
1313
importos
14+
importos.pathasosp
1415
fromstatimportS_ISLNK
1516
importsubprocess
1617
importsys
1718
importtempfile
1819

19-
fromgit.compatimport (
20-
force_bytes,
21-
defenc,
22-
)
23-
fromgit.excimportGitCommandError,CheckoutError,GitError,InvalidGitRepositoryError
24-
fromgit.objectsimport (
25-
Blob,
26-
Submodule,
27-
Tree,
28-
Object,
29-
Commit,
30-
)
20+
fromgit.compatimportdefenc,force_bytes
21+
importgit.diffasgit_diff
22+
fromgit.excimportCheckoutError,GitCommandError,GitError,InvalidGitRepositoryError
23+
fromgit.objectsimportBlob,Commit,Object,Submodule,Tree
3124
fromgit.objects.utilimportSerializable
3225
fromgit.utilimport (
3326
LazyMixin,
@@ -41,24 +34,17 @@
4134
fromgitdb.baseimportIStream
4235
fromgitdb.dbimportMemoryDB
4336

44-
importgit.diffasgit_diff
45-
importos.pathasosp
46-
4737
from .funimport (
38+
S_IFGITLINK,
39+
aggressive_tree_merge,
4840
entry_key,
49-
write_cache,
5041
read_cache,
51-
aggressive_tree_merge,
52-
write_tree_from_cache,
53-
stat_mode_to_index_mode,
54-
S_IFGITLINK,
5542
run_commit_hook,
43+
stat_mode_to_index_mode,
44+
write_cache,
45+
write_tree_from_cache,
5646
)
57-
from .typimport (
58-
BaseIndexEntry,
59-
IndexEntry,
60-
StageType,
61-
)
47+
from .typimportBaseIndexEntry,IndexEntry,StageType
6248
from .utilimportTemporaryFileSwap,post_clear_cache,default_index,git_working_dir
6349

6450
# typing -----------------------------------------------------------------------------
@@ -80,12 +66,13 @@
8066
Union,
8167
)
8268

83-
fromgit.typesimportOld_commit_ish,Literal,PathLike
69+
fromgit.typesimportLiteral,PathLike
8470

8571
ifTYPE_CHECKING:
8672
fromsubprocessimportPopen
87-
fromgit.repoimportRepo
73+
8874
fromgit.refs.referenceimportReference
75+
fromgit.repoimportRepo
8976
fromgit.utilimportActor
9077

9178

@@ -1127,7 +1114,7 @@ def move(
11271114
defcommit(
11281115
self,
11291116
message:str,
1130-
parent_commits:Union[Old_commit_ish,None]=None,
1117+
parent_commits:Union[List[Commit],None]=None,
11311118
head:bool=True,
11321119
author:Union[None,"Actor"]=None,
11331120
committer:Union[None,"Actor"]=None,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp