Skip to content

Commit 0b3f6da

Browse files
authored
Fix misleading doc for git_index_find
In https://github.com/libgit2/libgit2/pull/5723/files/fc46dc06f52f854f74371682f911f13856c68edb#r540092847, I was confused by the semantics of `git_index_find`. The documentation says both that it returns the output value in `at_pos` and that it returns it directly as an `int`. This is incorrect; the return value is only returned via `at_pos`.
1 parent 868f4bc commit 0b3f6da

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

include/git2/index.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -702,7 +702,7 @@ GIT_EXTERN(int) git_index_update_all(
702702
* @param at_pos the address to which the position of the index entry is written (optional)
703703
* @param index an existing index object
704704
* @param path path to search
705-
* @return a zero-based position in the index if found; GIT_ENOTFOUND otherwise
705+
* @return 0 with valid value in at_pos; an error code otherwise
706706
*/
707707
GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path);
708708

0 commit comments

Comments
 (0)