Skip to content

Docstring Typo #1138

@bmccary

Description

@bmccary

In the docstring for BaseRepository.diff, the kwarg argument should be flags, not flag (note the missing s).

pygit2/pygit2/repository.py

Lines 509 to 512 in d327788

flag
A combination of GIT_DIFF_* constants. For a list of the constants,
with a description, see git_diff_option_t in
https://github.com/libgit2/libgit2/blob/master/include/git2/diff.h

The function BaseRepository.diff maps to various other functions where the argument is flags, e.g.,

pygit2/pygit2/_pygit2.pyi

Lines 543 to 546 in d327788

class Tree(Object):
def diff_to_index(self, index: Index, flags: int = GIT_DIFF_NORMAL, context_lines: int = 3, interhunk_lines: int = 0) -> Diff: ...
def diff_to_tree(self, tree: Tree = ..., flags: int = ..., context_lines: int = ..., interhunk_lines: int = ..., swap: bool = ...) -> Diff: ...
def diff_to_workdir(self, flags: int = GIT_DIFF_NORMAL, context_lines: int = 3, interhunk_lines: int = 0) -> Diff: ...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions