Skip to content

Commit

Permalink
Fix docstring/type annotation for DiffDelta.status
Browse files Browse the repository at this point in the history
  • Loading branch information
jorio committed May 24, 2024
1 parent facaf22 commit 7bed9d2
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 3 deletions.
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

0 comments on commit 7bed9d2

Please sign in to comment.