Skip to content
This repository has been archived by the owner on Jan 16, 2024. It is now read-only.

Commit

Permalink
Bundle 1.4.2-1 (2022-03-21)
Browse files Browse the repository at this point in the history
  • Loading branch information
jeroen committed Mar 21, 2022
1 parent 81257f1 commit 6fc0c12
Show file tree
Hide file tree
Showing 228 changed files with 37,363 additions and 259 deletions.
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# libgit2 1.4.2-1

- mingw-w64-i686-zlib-1.2.11-9100-any.pkg.tar.xz
- mingw-w64-i686-openssl-1.1.1.m-9800-any.pkg.tar.xz
- mingw-w64-i686-libssh2-1.10.0-9800-any.pkg.tar.xz
- mingw-w64-i686-libgit2-1.4.2-1-any.pkg.tar.xz
- mingw-w64-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
- mingw-w64-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
- mingw-w64-x86_64-libssh2-1.10.0-9800-any.pkg.tar.xz
- mingw-w64-x86_64-libgit2-1.4.2-1-any.pkg.tar.xz
- mingw-w64-ucrt-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
- mingw-w64-ucrt-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
- mingw-w64-ucrt-x86_64-libssh2-1.10.0-9800-any.pkg.tar.xz
- mingw-w64-ucrt-x86_64-libgit2-1.4.2-1-any.pkg.tar.xz
18 changes: 16 additions & 2 deletions include/git2/apply.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,8 @@ GIT_BEGIN_DECL
*
* @param delta The delta to be applied
* @param payload User-specified payload
* @return 0 if the delta is applied, < 0 if the apply process will be aborted
* or > 0 if the delta will not be applied.
*/
typedef int GIT_CALLBACK(git_apply_delta_cb)(
const git_diff_delta *delta,
Expand All @@ -48,6 +50,8 @@ typedef int GIT_CALLBACK(git_apply_delta_cb)(
*
* @param hunk The hunk to be applied
* @param payload User-specified payload
* @return 0 if the hunk is applied, < 0 if the apply process will be aborted
* or > 0 if the hunk will not be applied.
*/
typedef int GIT_CALLBACK(git_apply_hunk_cb)(
const git_diff_hunk *hunk,
Expand All @@ -59,7 +63,7 @@ typedef enum {
* Don't actually make changes, just test that the patch applies.
* This is the equivalent of `git apply --check`.
*/
GIT_APPLY_CHECK = (1 << 0),
GIT_APPLY_CHECK = (1 << 0)
} git_apply_flags_t;

/**
Expand Down Expand Up @@ -89,6 +93,16 @@ typedef struct {
#define GIT_APPLY_OPTIONS_VERSION 1
#define GIT_APPLY_OPTIONS_INIT {GIT_APPLY_OPTIONS_VERSION}

/**
* Initialize git_apply_options structure
*
* Initialize a `git_apply_options` with default values. Equivalent to creating
* an instance with GIT_APPLY_OPTIONS_INIT.
*
* @param opts The `git_apply_options` struct to initialize.
* @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION`
* @return 0 on success or -1 on failure.
*/
GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int version);

/**
Expand Down Expand Up @@ -127,7 +141,7 @@ typedef enum {
* Apply the patch to both the working directory and the index.
* This is the equivalent of `git apply --index`.
*/
GIT_APPLY_LOCATION_BOTH = 2,
GIT_APPLY_LOCATION_BOTH = 2
} git_apply_location_t;

/**
Expand Down
13 changes: 11 additions & 2 deletions include/git2/attr.h
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ typedef enum {
GIT_ATTR_VALUE_UNSPECIFIED = 0, /**< The attribute has been left unspecified */
GIT_ATTR_VALUE_TRUE, /**< The attribute has been set */
GIT_ATTR_VALUE_FALSE, /**< The attribute has been unset */
GIT_ATTR_VALUE_STRING, /**< This attribute has a value */
GIT_ATTR_VALUE_STRING /**< This attribute has a value */
} git_attr_value_t;

/**
Expand Down Expand Up @@ -177,6 +177,7 @@ typedef struct {
* not have to exist, but if it does not, then it will be
* treated as a plain file (not a directory).
* @param name The name of the attribute to look up.
* @return 0 or an error code.
*/
GIT_EXTERN(int) git_attr_get(
const char **value_out,
Expand All @@ -199,6 +200,7 @@ GIT_EXTERN(int) git_attr_get(
* not have to exist, but if it does not, then it will be
* treated as a plain file (not a directory).
* @param name The name of the attribute to look up.
* @return 0 or an error code.
*/
GIT_EXTERN(int) git_attr_get_ext(
const char **value_out,
Expand Down Expand Up @@ -235,6 +237,7 @@ GIT_EXTERN(int) git_attr_get_ext(
* it will be treated as a plain file (i.e. not a directory).
* @param num_attr The number of attributes being looked up
* @param names An array of num_attr strings containing attribute names.
* @return 0 or an error code.
*/
GIT_EXTERN(int) git_attr_get_many(
const char **values_out,
Expand All @@ -259,6 +262,7 @@ GIT_EXTERN(int) git_attr_get_many(
* it will be treated as a plain file (i.e. not a directory).
* @param num_attr The number of attributes being looked up
* @param names An array of num_attr strings containing attribute names.
* @return 0 or an error code.
*/
GIT_EXTERN(int) git_attr_get_many_ext(
const char **values_out,
Expand Down Expand Up @@ -344,11 +348,16 @@ GIT_EXTERN(int) git_attr_cache_flush(
* Add a macro definition.
*
* Macros will automatically be loaded from the top level `.gitattributes`
* file of the repository (plus the build-in "binary" macro). This
* file of the repository (plus the built-in "binary" macro). This
* function allows you to add others. For example, to add the default
* macro, you would call:
*
* git_attr_add_macro(repo, "binary", "-diff -crlf");
*
* @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.
*/
GIT_EXTERN(int) git_attr_add_macro(
git_repository *repo,
Expand Down
5 changes: 4 additions & 1 deletion include/git2/blame.h
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ typedef enum {
GIT_BLAME_USE_MAILMAP = (1<<5),

/** Ignore whitespace differences */
GIT_BLAME_IGNORE_WHITESPACE = (1<<6),
GIT_BLAME_IGNORE_WHITESPACE = (1<<6)
} git_blame_flag_t;

/**
Expand Down Expand Up @@ -203,6 +203,9 @@ typedef struct git_blame git_blame;

/**
* Gets the number of hunks that exist in the blame structure.
*
* @param blame The blame structure to query.
* @return The number of hunks.
*/
GIT_EXTERN(uint32_t) git_blame_get_hunk_count(git_blame *blame);

Expand Down
15 changes: 14 additions & 1 deletion include/git2/blob.h
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ typedef enum {
* When set, filters will be loaded from a `.gitattributes` file
* in the specified commit.
*/
GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3),
GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3)
} git_blob_filter_flag_t;

/**
Expand Down Expand Up @@ -284,12 +284,25 @@ GIT_EXTERN(int) git_blob_create_from_buffer(
*/
GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob);

/**
* Determine if the given content is most certainly binary or not;
* this is the same mechanism used by `git_blob_is_binary` but only
* looking at raw data.
*
* @param data The blob data which content should be analyzed
* @param len The length of the data
* @return 1 if the content of the blob is detected
* as binary; 0 otherwise.
*/
GIT_EXTERN(int) git_blob_data_is_binary(const char *data, size_t len);

/**
* Create an in-memory copy of a blob. The copy must be explicitly
* free'd or it will leak.
*
* @param out Pointer to store the copy of the object
* @param source Original object to copy
* @return 0.
*/
GIT_EXTERN(int) git_blob_dup(git_blob **out, git_blob *source);

Expand Down
2 changes: 2 additions & 0 deletions include/git2/branch.h
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ GIT_BEGIN_DECL
*
* @param out Pointer where to store the underlying reference.
*
* @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
* an already existing branch name.
Expand Down
96 changes: 18 additions & 78 deletions include/git2/buffer.h
Original file line number Diff line number Diff line change
Expand Up @@ -23,110 +23,50 @@ GIT_BEGIN_DECL
*
* Sometimes libgit2 wants to return an allocated data buffer to the
* caller and have the caller take responsibility for freeing that memory.
* This can be awkward if the caller does not have easy access to the same
* allocation functions that libgit2 is using. In those cases, libgit2
* will fill in a `git_buf` and the caller can use `git_buf_dispose()` to
* release it when they are done.
* To make ownership clear in these cases, libgit2 uses `git_buf` to
* return this data. Callers should use `git_buf_dispose()` to release
* the memory when they are done.
*
* A `git_buf` may also be used for the caller to pass in a reference to
* a block of memory they hold. In this case, libgit2 will not resize or
* free the memory, but will read from it as needed.
*
* Some APIs may occasionally do something slightly unusual with a buffer,
* such as setting `ptr` to a value that was passed in by the user. In
* those cases, the behavior will be clearly documented by the API.
* A `git_buf` contains a pointer to a NUL-terminated C string, and
* the length of the string (not including the NUL terminator).
*/
typedef struct {
/**
* The buffer contents.
*
* `ptr` points to the start of the allocated memory. If it is NULL,
* then the `git_buf` is considered empty and libgit2 will feel free
* to overwrite it with new data.
* The buffer contents. `ptr` points to the start of the buffer
* being returned. The buffer's length (in bytes) is specified
* by the `size` member of the structure, and contains a NUL
* terminator at position `(size + 1)`.
*/
char *ptr;
char *ptr;

/**
* `asize` holds the known total amount of allocated memory if the `ptr`
* was allocated by libgit2. It may be larger than `size`. If `ptr`
* was not allocated by libgit2 and should not be resized and/or freed,
* then `asize` will be set to zero.
* This field is reserved and unused.
*/
size_t asize;
size_t reserved;

/**
* `size` holds the size (in bytes) of the data that is actually used.
* The length (in bytes) of the buffer pointed to by `ptr`,
* not including a NUL terminator.
*/
size_t size;
} git_buf;

/**
* Static initializer for git_buf from static buffer
* Use to initialize a `git_buf` before passing it to a function that
* will populate it.
*/
#define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
#define GIT_BUF_INIT { NULL, 0, 0 }

/**
* Free the memory referred to by the git_buf.
*
* Note that this does not free the `git_buf` itself, just the memory
* pointed to by `buffer->ptr`. This will not free the memory if it looks
* like it was not allocated internally, but it will clear the buffer back
* to the empty state.
* pointed to by `buffer->ptr`.
*
* @param buffer The buffer to deallocate
*/
GIT_EXTERN(void) git_buf_dispose(git_buf *buffer);

/**
* Resize the buffer allocation to make more space.
*
* This will attempt to grow the buffer to accommodate the target size.
*
* If the buffer refers to memory that was not allocated by libgit2 (i.e.
* the `asize` field is zero), then `ptr` will be replaced with a newly
* allocated block of data. Be careful so that memory allocated by the
* caller is not lost. As a special variant, if you pass `target_size` as
* 0 and the memory is not allocated by libgit2, this will allocate a new
* buffer of size `size` and copy the external data into it.
*
* Currently, this will never shrink a buffer, only expand it.
*
* If the allocation fails, this will return an error and the buffer will be
* marked as invalid for future operations, invaliding the contents.
*
* @param buffer The buffer to be resized; may or may not be allocated yet
* @param target_size The desired available size
* @return 0 on success, -1 on allocation failure
*/
GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size);

/**
* Set buffer to a copy of some raw data.
*
* @param buffer The buffer to set
* @param data The data to copy into the buffer
* @param datalen The length of the data to copy into the buffer
* @return 0 on success, -1 on allocation failure
*/
GIT_EXTERN(int) git_buf_set(
git_buf *buffer, const void *data, size_t datalen);

/**
* Check quickly if buffer looks like it contains binary data
*
* @param buf Buffer to check
* @return 1 if buffer looks like non-text data
*/
GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf);

/**
* Check quickly if buffer contains a NUL byte
*
* @param buf Buffer to check
* @return 1 if buffer contains a NUL byte
*/
GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf);

GIT_END_DECL

/** @} */
Expand Down
4 changes: 2 additions & 2 deletions include/git2/cert.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ typedef enum git_cert_t {
* information about the certificate. This is used when using
* curl.
*/
GIT_CERT_STRARRAY,
GIT_CERT_STRARRAY
} git_cert_t;

/**
Expand Down Expand Up @@ -82,7 +82,7 @@ typedef enum {
/** SHA-256 is available */
GIT_CERT_SSH_SHA256 = (1 << 2),
/** Raw hostkey is available */
GIT_CERT_SSH_RAW = (1 << 3),
GIT_CERT_SSH_RAW = (1 << 3)
} git_cert_ssh_t;

typedef enum {
Expand Down
7 changes: 5 additions & 2 deletions include/git2/checkout.h
Original file line number Diff line number Diff line change
Expand Up @@ -182,15 +182,18 @@ typedef enum {
* notifications; don't update the working directory or index.
*/
GIT_CHECKOUT_DRY_RUN = (1u << 24),


/** Include common ancestor data in zdiff3 format for conflicts */
GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3 = (1u << 25),

/**
* THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED
*/

/** Recursively checkout submodules with same options (NOT IMPLEMENTED) */
GIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16),
/** Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) */
GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17),
GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17)

} git_checkout_strategy_t;

Expand Down
6 changes: 3 additions & 3 deletions include/git2/clone.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ typedef enum {
* Bypass the git-aware transport, but do not try to use
* hardlinks.
*/
GIT_CLONE_LOCAL_NO_LINKS,
GIT_CLONE_LOCAL_NO_LINKS
} git_clone_local_t;

/**
Expand All @@ -74,8 +74,8 @@ typedef int GIT_CALLBACK(git_remote_create_cb)(
void *payload);

/**
* The signature of a function matchin git_repository_init, with an
* aditional void * as callback payload.
* The signature of a function matching git_repository_init, with an
* additional void * as callback payload.
*
* Callers of git_clone my provide a function matching this signature
* to override the repository creation and customization process
Expand Down
2 changes: 2 additions & 0 deletions include/git2/commit.h
Original file line number Diff line number Diff line change
Expand Up @@ -479,6 +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 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.
Expand All @@ -499,6 +500,7 @@ GIT_EXTERN(int) git_commit_create_with_signature(
*
* @param out Pointer to store the copy of the commit
* @param source Original commit to copy
* @return 0
*/
GIT_EXTERN(int) git_commit_dup(git_commit **out, git_commit *source);

Expand Down
Loading

0 comments on commit 6fc0c12

Please sign in to comment.