Skip to content

Commit aaa4f4a

Browse files
committed
Rebase API review follow-ups
- Add rebase, Rebase and RebaseOperation to __all__ - RebaseOperationType docstring: operations are seen when iterating over or indexing a Rebase, there is no next() method - RebaseOperation.id docstring: for EXEC operations this is the zero OID (falsy), matching libgit2's by-value git_oid field Assisted-by: Kimi K3
1 parent e5f6b42 commit aaa4f4a

3 files changed

Lines changed: 7 additions & 3 deletions

File tree

pygit2/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -917,6 +917,9 @@ def filter_unregister(name: str) -> None:
917917
'IndexEntry',
918918
'packbuilder',
919919
'PackBuilder',
920+
'rebase',
921+
'Rebase',
922+
'RebaseOperation',
920923
'refspec',
921924
'remotes',
922925
'Remote',

pygit2/enums.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -999,7 +999,8 @@ class Option(IntEnum):
999999

10001000

10011001
class RebaseOperationType(IntEnum):
1002-
"""Type of rebase operation in-progress after calling Rebase.next()."""
1002+
"""Type of a rebase operation, as returned when iterating over or
1003+
indexing a Rebase."""
10031004

10041005
PICK = C.GIT_REBASE_OPERATION_PICK
10051006
"""The given commit is to be cherry-picked. The client should commit

pygit2/rebase.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,8 @@ def __init__(self, type: RebaseOperationType, id: Oid, exec: 'str | None') -> No
5959
'The type of rebase operation.'
6060

6161
self.id = id
62-
"""The commit ID being cherry-picked. This will be populated for
63-
all operations except those of type RebaseOperationType.EXEC."""
62+
"""The commit ID being cherry-picked. For operations of type
63+
RebaseOperationType.EXEC this is the zero OID."""
6464

6565
self.exec = exec
6666
"""The executable the user has requested be run. This will only

0 commit comments

Comments
 (0)