Commit d4232e7c91da8365910e3cb947626f3426472330

Edward Thomson 2022-01-17T21:21:54

Apply suggestions from code review

diff --git a/include/git2/attr.h b/include/git2/attr.h
index c930550..66100df 100644
--- a/include/git2/attr.h
+++ b/include/git2/attr.h
@@ -354,7 +354,7 @@ GIT_EXTERN(int) git_attr_cache_flush(
  *
  *     git_attr_add_macro(repo, "binary", "-diff -crlf");
  *
- * @param repo The repository where to add the macro.
+ * @param repo The repository to add the macro in.
  * @param name The name of the macro.
  * @param values The value for the macro.
  * @return 0 or an error code.
diff --git a/include/git2/branch.h b/include/git2/branch.h
index d33a24f..36a393d 100644
--- a/include/git2/branch.h
+++ b/include/git2/branch.h
@@ -34,7 +34,7 @@ GIT_BEGIN_DECL
  *
  * @param out Pointer where to store the underlying reference.
  *
- * @param repo the repository where to create the branch.
+ * @param repo the repository to create the branch in.
  *
  * @param branch_name Name for the branch; this name is
  * validated for consistency. It should also not conflict with
diff --git a/include/git2/commit.h b/include/git2/commit.h
index 2181a7d..67170cb 100644
--- a/include/git2/commit.h
+++ b/include/git2/commit.h
@@ -479,7 +479,7 @@ GIT_EXTERN(int) git_commit_create_buffer(
  * to the commit and write it into the given repository.
  *
  * @param out the resulting commit id
- * @param repo the repository where to create the commit.
+ * @param repo the repository to create the commit in.
  * @param commit_content the content of the unsigned commit object
  * @param signature the signature to add to the commit. Leave `NULL`
  * to create a commit without adding a signature field.
diff --git a/include/git2/config.h b/include/git2/config.h
index 07e0093..a5486a4 100644
--- a/include/git2/config.h
+++ b/include/git2/config.h
@@ -426,7 +426,7 @@ GIT_EXTERN(int) git_config_get_string_buf(git_buf *out, const git_config *cfg, c
  * interested in. Use NULL to indicate all
  * @param callback the function to be called on each value of the variable
  * @param payload opaque pointer to pass to the callback
- * @return non-zero to terminate the iteration.
+ * @return 0 or an error code.
  */
 GIT_EXTERN(int) git_config_get_multivar_foreach(const git_config *cfg, const char *name, const char *regexp, git_config_foreach_cb callback, void *payload);
 
@@ -442,7 +442,7 @@ GIT_EXTERN(int) git_config_get_multivar_foreach(const git_config *cfg, const cha
  * @param name the variable's name
  * @param regexp regular expression to filter which variables we're
  * interested in. Use NULL to indicate all
- * @return non-zero to terminate the iteration.
+ * @return 0 or an error code.
  */
 GIT_EXTERN(int) git_config_multivar_iterator_new(git_config_iterator **out, const git_config *cfg, const char *name, const char *regexp);
 
@@ -750,7 +750,7 @@ GIT_EXTERN(int) git_config_parse_path(git_buf *out, const char *value);
  * @param regexp regular expression to match against config names (can be NULL)
  * @param callback the function to call on each variable
  * @param payload the data to pass to the callback
- * @return non-zero to terminate the iteration.
+ * @return 0 or an error code.
  */
 GIT_EXTERN(int) git_config_backend_foreach_match(
 	git_config_backend *backend,
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 8af02a6..4bacbd3 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -136,8 +136,7 @@ GIT_EXTERN(int) git_indexer_commit(git_indexer *idx, git_indexer_progress *stats
  * names. This is only correct after the index has been finalized.
  *
  * @param idx the indexer instance
- * @return the packfile's hash. In casewhere the index has not been finalized,
- *	it will be zeroed out.
+ * @return the packfile's hash
  */
 GIT_EXTERN(const git_oid *) git_indexer_hash(const git_indexer *idx);
 
diff --git a/include/git2/object.h b/include/git2/object.h
index 2692a40..5610a47 100644
--- a/include/git2/object.h
+++ b/include/git2/object.h
@@ -221,7 +221,7 @@ GIT_EXTERN(int) git_object_peel(
  *
  * @param dest Pointer to store the copy of the object
  * @param source Original object to copy
- * @return 0
+ * @return 0 or an error code
  */
 GIT_EXTERN(int) git_object_dup(git_object **dest, git_object *source);
 
diff --git a/include/git2/odb.h b/include/git2/odb.h
index 7b8d6f9..effe2e5 100644
--- a/include/git2/odb.h
+++ b/include/git2/odb.h
@@ -348,7 +348,7 @@ GIT_EXTERN(int) git_odb_stream_finalize_write(git_oid *out, git_odb_stream *stre
  * Most backends don't implement streaming reads
  *
  * @param stream the stream
- * @param buffer the buffer where to store the readed data.
+ * @param buffer a user-allocated buffer to store the data in.
  * @param len the buffer's length
  * @return 0 if the read succeeded, error code otherwise
  */
diff --git a/include/git2/rebase.h b/include/git2/rebase.h
index 5edd443..b1ac71f 100644
--- a/include/git2/rebase.h
+++ b/include/git2/rebase.h
@@ -329,7 +329,7 @@ GIT_EXTERN(int) git_rebase_next(
  *
  * @param index The result index of the last operation.
  * @param rebase The in-progress rebase.
- * @return 0
+ * @return 0 or an error code
  */
 GIT_EXTERN(int) git_rebase_inmemory_index(
 	git_index **index,
diff --git a/include/git2/repository.h b/include/git2/repository.h
index 6692537..e276a8a 100644
--- a/include/git2/repository.h
+++ b/include/git2/repository.h
@@ -931,7 +931,7 @@ GIT_EXTERN(int) git_repository_is_shallow(git_repository *repo);
  * @param name where to store the pointer to the name
  * @param email where to store the pointer to the email
  * @param repo the repository
- * @return 0
+ * @return 0 or an error code
  */
 GIT_EXTERN(int) git_repository_ident(const char **name, const char **email, const git_repository *repo);
 
diff --git a/include/git2/revwalk.h b/include/git2/revwalk.h
index b8655e5..4aa9f5b 100644
--- a/include/git2/revwalk.h
+++ b/include/git2/revwalk.h
@@ -249,7 +249,7 @@ GIT_EXTERN(int) git_revwalk_push_range(git_revwalk *walk, const char *range);
  *
  * No parents other than the first for each commit will be enqueued.
  *
- * @param walk The revisionwlaker.
+ * @param walk The revision walker.
  * @return 0 or an error code
  */
 GIT_EXTERN(int) git_revwalk_simplify_first_parent(git_revwalk *walk);
@@ -278,7 +278,7 @@ GIT_EXTERN(git_repository *) git_revwalk_repository(git_revwalk *walk);
  *
  * @param commit_id oid of Commit
  * @param payload User-specified pointer to data to be passed as data payload
- * @return non-zero to hide the commmit and it parrent.
+ * @return non-zero to hide the commmit and it parent.
  */
 typedef int GIT_CALLBACK(git_revwalk_hide_cb)(
 	const git_oid *commit_id,