Skip to content

Commit

Permalink
Ammend the doc-string of Repository.diff()
Browse files Browse the repository at this point in the history
According to the old documentation, it was not clear how to compare 
working directory/index to a git object.
  • Loading branch information
mrh1997 authored Jul 11, 2016
1 parent c57a3ae commit ffc514f
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion pygit2/repository.py
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,23 @@ def diff(self, a=None, b=None, cached=False, flags=GIT_DIFF_NORMAL,
Keyword arguments:
a
None, a str (that refers to an Object, see revparse_single()) or a
Reference object.
If None, b must be None, too. In this case the working directory is
compared with the index. Otherwise the referred object is compared to
'b'.
b
None, a str (that refers to an Object, see revparse_single()) or a
Reference object.
If None, the working directory is compared to 'a'. (except
'cached' is True, in which case the index is compared to 'a').
Otherwise the referred object is compared to 'a'
cached
use staged changes instead of workdir
if 'b' is None, by default the working directory is compared to 'a'.
If 'cached' is set to True, the index/staging area is used for comparing.
flag
a GIT_DIFF_* constant
Expand Down

0 comments on commit ffc514f

Please sign in to comment.