Skip to content

Commit

Permalink
Improve PyDoc for Repository_hashfile
Browse files Browse the repository at this point in the history
  • Loading branch information
muhqu committed Feb 13, 2023
1 parent bba74c8 commit 3c24718
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/repository.c
Original file line number Diff line number Diff line change
Expand Up @@ -2438,7 +2438,15 @@ Repository_listall_stashes(Repository *self, PyObject *args)
PyDoc_STRVAR(Repository_hashfile__doc__,
"hashfile(path: str) -> Oid\n"
"\n"
"Calculate hash of file using repository filtering rules.");
"Calculate hash of file using repository filtering rules.\n"
"\n"
"If you simply want to calculate the hash of a file on disk with no filters, "
"you can just use the ``pygit2.hashfile`` API. However, if you want to hash "
"a file in the repository and you want to apply filtering rules (e.g. crlf "
"filters) before generating the SHA, then use this function.\n"
"\n"
"Note: if the repository has ``core.safecrlf`` set to fail and the filtering "
"triggers that failure, then this function will raise ``GitError``.");

PyObject *
Repository_hashfile(Repository *self, PyObject *args)
Expand Down

0 comments on commit 3c24718

Please sign in to comment.