docs: remind people about git_libgit2_init

Currently `git_libgit2_init` must be called before you can work with the
library. Remind people about this as they read the documentation.
This commit is contained in:
Edward Thomson
2024-12-11 10:54:21 +00:00
parent 1738f891a1
commit f675ea3cd7
2 changed files with 28 additions and 0 deletions

View File

@@ -200,6 +200,10 @@ GIT_EXTERN(int) git_clone_options_init(
* git's defaults. You can use the options in the callback to
* customize how these are created.
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param[out] out pointer that will receive the resulting repository object
* @param url the remote repository to clone
* @param local_path local directory to clone to

View File

@@ -31,6 +31,10 @@ GIT_BEGIN_DECL
* The method will automatically detect if 'path' is a normal
* or bare repository or fail is 'path' is neither.
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param[out] out pointer to the repo which will be opened
* @param path the path to the repository
* @return 0 or an error code
@@ -84,6 +88,10 @@ GIT_EXTERN(int) git_repository_wrap_odb(
* The method will automatically detect if the repository is bare
* (if there is a repository).
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param out A pointer to a user-allocated git_buf which will contain
* the found path.
*
@@ -161,6 +169,10 @@ typedef enum {
/**
* Find and open a repository with extended controls.
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param[out] out Pointer to the repo which will be opened. This can
* actually be NULL if you only want to use the error code to
* see if a repo at this path could be opened.
@@ -189,6 +201,10 @@ GIT_EXTERN(int) git_repository_open_ext(
* if you're e.g. hosting git repositories and need to access them
* efficiently
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param[out] out Pointer to the repo which will be opened.
* @param bare_path Direct path to the bare repository
* @return 0 on success, or an error code
@@ -214,6 +230,10 @@ GIT_EXTERN(void) git_repository_free(git_repository *repo);
* TODO:
* - Reinit the repository
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param[out] out pointer to the repo which will be created or reinitialized
* @param path the path to the repository
* @param is_bare if true, a Git repository without a working directory is
@@ -404,6 +424,10 @@ GIT_EXTERN(int) git_repository_init_options_init(
* auto-detect the case sensitivity of the file system and if the
* file system supports file mode bits correctly.
*
* Note that the libgit2 library _must_ be initialized using
* `git_libgit2_init` before any APIs can be called, including
* this one.
*
* @param out Pointer to the repo which will be created or reinitialized.
* @param repo_path The path to the repository.
* @param opts Pointer to git_repository_init_options struct.