Skip to content

Fix docstring/type annotation for DiffDelta.status #1293

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions pygit2/_pygit2.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ from . import Index, Submodule
from .enums import (
ApplyLocation,
BranchType,
DeltaStatus,
DiffFind,
DiffFlag,
DiffOption,
DiffStatsFormat,
FileMode,
FileStatus,
MergeAnalysis,
MergePreference,
ObjectType,
Expand Down Expand Up @@ -171,7 +171,7 @@ class DiffDelta:
new_file: DiffFile
old_file: DiffFile
similarity: int
status: FileStatus
status: DeltaStatus
def status_char(self) -> str: ...

class DiffFile:
Expand Down
2 changes: 1 addition & 1 deletion src/diff.c
Original file line number Diff line number Diff line change
Expand Up @@ -323,7 +323,7 @@ DiffDelta_is_binary__get__(DiffDelta *self)
}

PyDoc_STRVAR(DiffDelta_status__doc__,
"An enums.FileStatus constant."
"An enums.DeltaStatus constant."
);

PyObject *
Expand Down
2 changes: 2 additions & 0 deletions test/test_diff.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,6 +339,8 @@ def test_deltas(barerepo):
assert len(deltas) == len(patches)
for i, delta in enumerate(deltas):
patch_delta = patches[i].delta
assert isinstance(delta.status, DeltaStatus)
assert isinstance(patch_delta.status, DeltaStatus)
assert delta.status == patch_delta.status
assert delta.similarity == patch_delta.similarity
assert delta.nfiles == patch_delta.nfiles
Expand Down
Loading