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

Commit 6fc0c12

Browse files
committed
Bundle 1.4.2-1 (2022-03-21)
1 parent 81257f1 commit 6fc0c12

File tree

228 files changed

+37363
-259
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

228 files changed

+37363
-259
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# libgit2 1.4.2-1
2+
3+
- mingw-w64-i686-zlib-1.2.11-9100-any.pkg.tar.xz
4+
- mingw-w64-i686-openssl-1.1.1.m-9800-any.pkg.tar.xz
5+
- mingw-w64-i686-libssh2-1.10.0-9800-any.pkg.tar.xz
6+
- mingw-w64-i686-libgit2-1.4.2-1-any.pkg.tar.xz
7+
- mingw-w64-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
8+
- mingw-w64-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
9+
- mingw-w64-x86_64-libssh2-1.10.0-9800-any.pkg.tar.xz
10+
- mingw-w64-x86_64-libgit2-1.4.2-1-any.pkg.tar.xz
11+
- mingw-w64-ucrt-x86_64-zlib-1.2.11-9100-any.pkg.tar.xz
12+
- mingw-w64-ucrt-x86_64-openssl-1.1.1.m-9800-any.pkg.tar.xz
13+
- mingw-w64-ucrt-x86_64-libssh2-1.10.0-9800-any.pkg.tar.xz
14+
- mingw-w64-ucrt-x86_64-libgit2-1.4.2-1-any.pkg.tar.xz

include/git2/apply.h

+16-2
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,8 @@ GIT_BEGIN_DECL
3232
*
3333
* @param delta The delta to be applied
3434
* @param payload User-specified payload
35+
* @return 0 if the delta is applied, < 0 if the apply process will be aborted
36+
* or > 0 if the delta will not be applied.
3537
*/
3638
typedef int GIT_CALLBACK(git_apply_delta_cb)(
3739
const git_diff_delta *delta,
@@ -48,6 +50,8 @@ typedef int GIT_CALLBACK(git_apply_delta_cb)(
4850
*
4951
* @param hunk The hunk to be applied
5052
* @param payload User-specified payload
53+
* @return 0 if the hunk is applied, < 0 if the apply process will be aborted
54+
* or > 0 if the hunk will not be applied.
5155
*/
5256
typedef int GIT_CALLBACK(git_apply_hunk_cb)(
5357
const git_diff_hunk *hunk,
@@ -59,7 +63,7 @@ typedef enum {
5963
* Don't actually make changes, just test that the patch applies.
6064
* This is the equivalent of `git apply --check`.
6165
*/
62-
GIT_APPLY_CHECK = (1 << 0),
66+
GIT_APPLY_CHECK = (1 << 0)
6367
} git_apply_flags_t;
6468

6569
/**
@@ -89,6 +93,16 @@ typedef struct {
8993
#define GIT_APPLY_OPTIONS_VERSION 1
9094
#define GIT_APPLY_OPTIONS_INIT {GIT_APPLY_OPTIONS_VERSION}
9195

96+
/**
97+
* Initialize git_apply_options structure
98+
*
99+
* Initialize a `git_apply_options` with default values. Equivalent to creating
100+
* an instance with GIT_APPLY_OPTIONS_INIT.
101+
*
102+
* @param opts The `git_apply_options` struct to initialize.
103+
* @param version The struct version; pass `GIT_APPLY_OPTIONS_VERSION`
104+
* @return 0 on success or -1 on failure.
105+
*/
92106
GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int version);
93107

94108
/**
@@ -127,7 +141,7 @@ typedef enum {
127141
* Apply the patch to both the working directory and the index.
128142
* This is the equivalent of `git apply --index`.
129143
*/
130-
GIT_APPLY_LOCATION_BOTH = 2,
144+
GIT_APPLY_LOCATION_BOTH = 2
131145
} git_apply_location_t;
132146

133147
/**

include/git2/attr.h

+11-2
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,7 @@ typedef enum {
8383
GIT_ATTR_VALUE_UNSPECIFIED = 0, /**< The attribute has been left unspecified */
8484
GIT_ATTR_VALUE_TRUE, /**< The attribute has been set */
8585
GIT_ATTR_VALUE_FALSE, /**< The attribute has been unset */
86-
GIT_ATTR_VALUE_STRING, /**< This attribute has a value */
86+
GIT_ATTR_VALUE_STRING /**< This attribute has a value */
8787
} git_attr_value_t;
8888

8989
/**
@@ -177,6 +177,7 @@ typedef struct {
177177
* not have to exist, but if it does not, then it will be
178178
* treated as a plain file (not a directory).
179179
* @param name The name of the attribute to look up.
180+
* @return 0 or an error code.
180181
*/
181182
GIT_EXTERN(int) git_attr_get(
182183
const char **value_out,
@@ -199,6 +200,7 @@ GIT_EXTERN(int) git_attr_get(
199200
* not have to exist, but if it does not, then it will be
200201
* treated as a plain file (not a directory).
201202
* @param name The name of the attribute to look up.
203+
* @return 0 or an error code.
202204
*/
203205
GIT_EXTERN(int) git_attr_get_ext(
204206
const char **value_out,
@@ -235,6 +237,7 @@ GIT_EXTERN(int) git_attr_get_ext(
235237
* it will be treated as a plain file (i.e. not a directory).
236238
* @param num_attr The number of attributes being looked up
237239
* @param names An array of num_attr strings containing attribute names.
240+
* @return 0 or an error code.
238241
*/
239242
GIT_EXTERN(int) git_attr_get_many(
240243
const char **values_out,
@@ -259,6 +262,7 @@ GIT_EXTERN(int) git_attr_get_many(
259262
* it will be treated as a plain file (i.e. not a directory).
260263
* @param num_attr The number of attributes being looked up
261264
* @param names An array of num_attr strings containing attribute names.
265+
* @return 0 or an error code.
262266
*/
263267
GIT_EXTERN(int) git_attr_get_many_ext(
264268
const char **values_out,
@@ -344,11 +348,16 @@ GIT_EXTERN(int) git_attr_cache_flush(
344348
* Add a macro definition.
345349
*
346350
* Macros will automatically be loaded from the top level `.gitattributes`
347-
* file of the repository (plus the build-in "binary" macro). This
351+
* file of the repository (plus the built-in "binary" macro). This
348352
* function allows you to add others. For example, to add the default
349353
* macro, you would call:
350354
*
351355
* git_attr_add_macro(repo, "binary", "-diff -crlf");
356+
*
357+
* @param repo The repository to add the macro in.
358+
* @param name The name of the macro.
359+
* @param values The value for the macro.
360+
* @return 0 or an error code.
352361
*/
353362
GIT_EXTERN(int) git_attr_add_macro(
354363
git_repository *repo,

include/git2/blame.h

+4-1
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ typedef enum {
7373
GIT_BLAME_USE_MAILMAP = (1<<5),
7474

7575
/** Ignore whitespace differences */
76-
GIT_BLAME_IGNORE_WHITESPACE = (1<<6),
76+
GIT_BLAME_IGNORE_WHITESPACE = (1<<6)
7777
} git_blame_flag_t;
7878

7979
/**
@@ -203,6 +203,9 @@ typedef struct git_blame git_blame;
203203

204204
/**
205205
* Gets the number of hunks that exist in the blame structure.
206+
*
207+
* @param blame The blame structure to query.
208+
* @return The number of hunks.
206209
*/
207210
GIT_EXTERN(uint32_t) git_blame_get_hunk_count(git_blame *blame);
208211

include/git2/blob.h

+14-1
Original file line numberDiff line numberDiff line change
@@ -119,7 +119,7 @@ typedef enum {
119119
* When set, filters will be loaded from a `.gitattributes` file
120120
* in the specified commit.
121121
*/
122-
GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3),
122+
GIT_BLOB_FILTER_ATTRIBUTES_FROM_COMMIT = (1 << 3)
123123
} git_blob_filter_flag_t;
124124

125125
/**
@@ -284,12 +284,25 @@ GIT_EXTERN(int) git_blob_create_from_buffer(
284284
*/
285285
GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob);
286286

287+
/**
288+
* Determine if the given content is most certainly binary or not;
289+
* this is the same mechanism used by `git_blob_is_binary` but only
290+
* looking at raw data.
291+
*
292+
* @param data The blob data which content should be analyzed
293+
* @param len The length of the data
294+
* @return 1 if the content of the blob is detected
295+
* as binary; 0 otherwise.
296+
*/
297+
GIT_EXTERN(int) git_blob_data_is_binary(const char *data, size_t len);
298+
287299
/**
288300
* Create an in-memory copy of a blob. The copy must be explicitly
289301
* free'd or it will leak.
290302
*
291303
* @param out Pointer to store the copy of the object
292304
* @param source Original object to copy
305+
* @return 0.
293306
*/
294307
GIT_EXTERN(int) git_blob_dup(git_blob **out, git_blob *source);
295308

include/git2/branch.h

+2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,8 @@ GIT_BEGIN_DECL
3434
*
3535
* @param out Pointer where to store the underlying reference.
3636
*
37+
* @param repo the repository to create the branch in.
38+
*
3739
* @param branch_name Name for the branch; this name is
3840
* validated for consistency. It should also not conflict with
3941
* an already existing branch name.

include/git2/buffer.h

+18-78
Original file line numberDiff line numberDiff line change
@@ -23,110 +23,50 @@ GIT_BEGIN_DECL
2323
*
2424
* Sometimes libgit2 wants to return an allocated data buffer to the
2525
* caller and have the caller take responsibility for freeing that memory.
26-
* This can be awkward if the caller does not have easy access to the same
27-
* allocation functions that libgit2 is using. In those cases, libgit2
28-
* will fill in a `git_buf` and the caller can use `git_buf_dispose()` to
29-
* release it when they are done.
26+
* To make ownership clear in these cases, libgit2 uses `git_buf` to
27+
* return this data. Callers should use `git_buf_dispose()` to release
28+
* the memory when they are done.
3029
*
31-
* A `git_buf` may also be used for the caller to pass in a reference to
32-
* a block of memory they hold. In this case, libgit2 will not resize or
33-
* free the memory, but will read from it as needed.
34-
*
35-
* Some APIs may occasionally do something slightly unusual with a buffer,
36-
* such as setting `ptr` to a value that was passed in by the user. In
37-
* those cases, the behavior will be clearly documented by the API.
30+
* A `git_buf` contains a pointer to a NUL-terminated C string, and
31+
* the length of the string (not including the NUL terminator).
3832
*/
3933
typedef struct {
4034
/**
41-
* The buffer contents.
42-
*
43-
* `ptr` points to the start of the allocated memory. If it is NULL,
44-
* then the `git_buf` is considered empty and libgit2 will feel free
45-
* to overwrite it with new data.
35+
* The buffer contents. `ptr` points to the start of the buffer
36+
* being returned. The buffer's length (in bytes) is specified
37+
* by the `size` member of the structure, and contains a NUL
38+
* terminator at position `(size + 1)`.
4639
*/
47-
char *ptr;
40+
char *ptr;
4841

4942
/**
50-
* `asize` holds the known total amount of allocated memory if the `ptr`
51-
* was allocated by libgit2. It may be larger than `size`. If `ptr`
52-
* was not allocated by libgit2 and should not be resized and/or freed,
53-
* then `asize` will be set to zero.
43+
* This field is reserved and unused.
5444
*/
55-
size_t asize;
45+
size_t reserved;
5646

5747
/**
58-
* `size` holds the size (in bytes) of the data that is actually used.
48+
* The length (in bytes) of the buffer pointed to by `ptr`,
49+
* not including a NUL terminator.
5950
*/
6051
size_t size;
6152
} git_buf;
6253

6354
/**
64-
* Static initializer for git_buf from static buffer
55+
* Use to initialize a `git_buf` before passing it to a function that
56+
* will populate it.
6557
*/
66-
#define GIT_BUF_INIT_CONST(STR,LEN) { (char *)(STR), 0, (size_t)(LEN) }
58+
#define GIT_BUF_INIT { NULL, 0, 0 }
6759

6860
/**
6961
* Free the memory referred to by the git_buf.
7062
*
7163
* Note that this does not free the `git_buf` itself, just the memory
72-
* pointed to by `buffer->ptr`. This will not free the memory if it looks
73-
* like it was not allocated internally, but it will clear the buffer back
74-
* to the empty state.
64+
* pointed to by `buffer->ptr`.
7565
*
7666
* @param buffer The buffer to deallocate
7767
*/
7868
GIT_EXTERN(void) git_buf_dispose(git_buf *buffer);
7969

80-
/**
81-
* Resize the buffer allocation to make more space.
82-
*
83-
* This will attempt to grow the buffer to accommodate the target size.
84-
*
85-
* If the buffer refers to memory that was not allocated by libgit2 (i.e.
86-
* the `asize` field is zero), then `ptr` will be replaced with a newly
87-
* allocated block of data. Be careful so that memory allocated by the
88-
* caller is not lost. As a special variant, if you pass `target_size` as
89-
* 0 and the memory is not allocated by libgit2, this will allocate a new
90-
* buffer of size `size` and copy the external data into it.
91-
*
92-
* Currently, this will never shrink a buffer, only expand it.
93-
*
94-
* If the allocation fails, this will return an error and the buffer will be
95-
* marked as invalid for future operations, invaliding the contents.
96-
*
97-
* @param buffer The buffer to be resized; may or may not be allocated yet
98-
* @param target_size The desired available size
99-
* @return 0 on success, -1 on allocation failure
100-
*/
101-
GIT_EXTERN(int) git_buf_grow(git_buf *buffer, size_t target_size);
102-
103-
/**
104-
* Set buffer to a copy of some raw data.
105-
*
106-
* @param buffer The buffer to set
107-
* @param data The data to copy into the buffer
108-
* @param datalen The length of the data to copy into the buffer
109-
* @return 0 on success, -1 on allocation failure
110-
*/
111-
GIT_EXTERN(int) git_buf_set(
112-
git_buf *buffer, const void *data, size_t datalen);
113-
114-
/**
115-
* Check quickly if buffer looks like it contains binary data
116-
*
117-
* @param buf Buffer to check
118-
* @return 1 if buffer looks like non-text data
119-
*/
120-
GIT_EXTERN(int) git_buf_is_binary(const git_buf *buf);
121-
122-
/**
123-
* Check quickly if buffer contains a NUL byte
124-
*
125-
* @param buf Buffer to check
126-
* @return 1 if buffer contains a NUL byte
127-
*/
128-
GIT_EXTERN(int) git_buf_contains_nul(const git_buf *buf);
129-
13070
GIT_END_DECL
13171

13272
/** @} */

include/git2/cert.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ typedef enum git_cert_t {
4444
* information about the certificate. This is used when using
4545
* curl.
4646
*/
47-
GIT_CERT_STRARRAY,
47+
GIT_CERT_STRARRAY
4848
} git_cert_t;
4949

5050
/**
@@ -82,7 +82,7 @@ typedef enum {
8282
/** SHA-256 is available */
8383
GIT_CERT_SSH_SHA256 = (1 << 2),
8484
/** Raw hostkey is available */
85-
GIT_CERT_SSH_RAW = (1 << 3),
85+
GIT_CERT_SSH_RAW = (1 << 3)
8686
} git_cert_ssh_t;
8787

8888
typedef enum {

include/git2/checkout.h

+5-2
Original file line numberDiff line numberDiff line change
@@ -182,15 +182,18 @@ typedef enum {
182182
* notifications; don't update the working directory or index.
183183
*/
184184
GIT_CHECKOUT_DRY_RUN = (1u << 24),
185-
185+
186+
/** Include common ancestor data in zdiff3 format for conflicts */
187+
GIT_CHECKOUT_CONFLICT_STYLE_ZDIFF3 = (1u << 25),
188+
186189
/**
187190
* THE FOLLOWING OPTIONS ARE NOT YET IMPLEMENTED
188191
*/
189192

190193
/** Recursively checkout submodules with same options (NOT IMPLEMENTED) */
191194
GIT_CHECKOUT_UPDATE_SUBMODULES = (1u << 16),
192195
/** Recursively checkout submodules if HEAD moved in super repo (NOT IMPLEMENTED) */
193-
GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17),
196+
GIT_CHECKOUT_UPDATE_SUBMODULES_IF_CHANGED = (1u << 17)
194197

195198
} git_checkout_strategy_t;
196199

include/git2/clone.h

+3-3
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ typedef enum {
4949
* Bypass the git-aware transport, but do not try to use
5050
* hardlinks.
5151
*/
52-
GIT_CLONE_LOCAL_NO_LINKS,
52+
GIT_CLONE_LOCAL_NO_LINKS
5353
} git_clone_local_t;
5454

5555
/**
@@ -74,8 +74,8 @@ typedef int GIT_CALLBACK(git_remote_create_cb)(
7474
void *payload);
7575

7676
/**
77-
* The signature of a function matchin git_repository_init, with an
78-
* aditional void * as callback payload.
77+
* The signature of a function matching git_repository_init, with an
78+
* additional void * as callback payload.
7979
*
8080
* Callers of git_clone my provide a function matching this signature
8181
* to override the repository creation and customization process

include/git2/commit.h

+2
Original file line numberDiff line numberDiff line change
@@ -479,6 +479,7 @@ GIT_EXTERN(int) git_commit_create_buffer(
479479
* to the commit and write it into the given repository.
480480
*
481481
* @param out the resulting commit id
482+
* @param repo the repository to create the commit in.
482483
* @param commit_content the content of the unsigned commit object
483484
* @param signature the signature to add to the commit. Leave `NULL`
484485
* to create a commit without adding a signature field.
@@ -499,6 +500,7 @@ GIT_EXTERN(int) git_commit_create_with_signature(
499500
*
500501
* @param out Pointer to store the copy of the commit
501502
* @param source Original commit to copy
503+
* @return 0
502504
*/
503505
GIT_EXTERN(int) git_commit_dup(git_commit **out, git_commit *source);
504506

0 commit comments

Comments
 (0)