Skip to content

Commit 39fd764

Browse files
committed
Merge branch 'main' into respect-force-flag-in-remote-fetch
2 parents 8ad5998 + e167476 commit 39fd764

File tree

10 files changed

+30
-14
lines changed

10 files changed

+30
-14
lines changed

README.md

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,7 +104,8 @@ Getting Help
104104

105105
**Chat with us**
106106

107-
- via IRC: join [#libgit2](https://webchat.freenode.net/#libgit2) on Freenode
107+
- via IRC: join [#libgit2](https://web.libera.chat/#libgit2) on
108+
[libera](https://libera.chat).
108109
- via Slack: visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up,
109110
then join us in `#libgit2`
110111

docs/contributing.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ easily accessible permanent record of the conversation.
3535

3636
## Libgit2 Versions
3737

38-
The `master` branch is the main branch where development happens.
38+
The `main` branch is the main branch where development happens.
3939
Releases are tagged
4040
(e.g. [v0.21.0](https://github.com/libgit2/libgit2/releases/tag/v0.21.0) )
4141
and when a critical bug fix needs to be backported, it will be done on a
@@ -51,7 +51,7 @@ commit SHA
5151
Using [`git describe`](http://git-scm.com/docs/git-describe) is a
5252
great way to tell us what version you're working with.
5353

54-
If you're not running against the latest `master` branch version,
54+
If you're not running against the latest `main` branch version,
5555
please compile and test against that to avoid re-reporting an issue that's
5656
already been fixed.
5757

@@ -68,11 +68,11 @@ flow](https://guides.github.com/introduction/flow/index.html), where
6868
contributors fork the [libgit2 repository](https://github.com/libgit2/libgit2),
6969
make their changes on branch, and submit a
7070
[Pull Request](https://help.github.com/articles/using-pull-requests)
71-
(a.k.a. "PR"). Pull requests should usually be targeted at the `master`
71+
(a.k.a. "PR"). Pull requests should usually be targeted at the `main`
7272
branch.
7373

7474
Life will be a lot easier for you (and us) if you follow this pattern
75-
(i.e. fork, named branch, submit PR). If you use your fork's `master`
75+
(i.e. fork, named branch, submit PR). If you use your fork's `main`
7676
branch directly, things can get messy.
7777

7878
Please include a nice description of your changes when you submit your PR;

docs/release.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Releasing the library
22

3-
We have three kinds of releases: "full" releases, maintenance releases and security releases. Full ones release the state of the `master` branch whereas maintenance releases provide bugfixes building on top of the currently released series. Security releases are also for the current series but only contain security fixes on top of the previous release.
3+
We have three kinds of releases: "full" releases, maintenance releases and security releases. Full ones release the state of the `main` branch whereas maintenance releases provide bugfixes building on top of the currently released series. Security releases are also for the current series but only contain security fixes on top of the previous release.
44

55
## Full release
66

@@ -40,7 +40,7 @@ followed by the three sections in the changelog. For release candidates we can a
4040

4141
During the freeze, and certainly after the first release candidate, any bindings the core team work with should be updated in order to discover any issues that might come up with the multitude of approaches to memory management, embedding or linking.
4242

43-
Create a branch `maint/v0.X` at the current state of `master` after you've created the tag. This will be used for maintenance releases and lets our dependents track the latest state of the series.
43+
Create a branch `maint/v0.X` at the current state of `main` after you've created the tag. This will be used for maintenance releases and lets our dependents track the latest state of the series.
4444

4545
## Maintenance release
4646

@@ -76,7 +76,7 @@ We use docurium to generate our documentation. It is a tool written in ruby whic
7676

7777
gem install docurium
7878

79-
and run it against our description file with the tip of master checked out.
79+
and run it against our description file with the tip of `main` checked out.
8080

8181
cm doc api.docurium
8282

include/git2/apply.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -100,6 +100,7 @@ GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int ver
100100
* @param preimage the tree to apply the diff to
101101
* @param diff the diff to apply
102102
* @param options the options for the apply (or null for defaults)
103+
* @return 0 or an error code
103104
*/
104105
GIT_EXTERN(int) git_apply_to_tree(
105106
git_index **out,
@@ -137,6 +138,7 @@ typedef enum {
137138
* @param diff the diff to apply
138139
* @param location the location to apply (workdir, index or both)
139140
* @param options the options for the apply (or null for defaults)
141+
* @return 0 or an error code
140142
*/
141143
GIT_EXTERN(int) git_apply(
142144
git_repository *repo,

include/git2/common.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -356,6 +356,11 @@ typedef enum {
356356
* >
357357
* > - `ciphers` is the list of ciphers that are eanbled.
358358
*
359+
* * opts(GIT_OPT_GET_USER_AGENT, git_buf *out)
360+
*
361+
* > Get the value of the User-Agent header.
362+
* > The User-Agent is written to the `out` buffer.
363+
*
359364
* * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)
360365
*
361366
* > Enable or disable the use of "offset deltas" when creating packfiles,

include/git2/index.h

Lines changed: 2 additions & 2 deletions
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 or an error code
706706
*/
707707
GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path);
708708

@@ -713,7 +713,7 @@ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *pat
713713
* @param at_pos the address to which the position of the index entry is written (optional)
714714
* @param index an existing index object
715715
* @param prefix the prefix to search for
716-
* @return 0 with valid value in at_pos; an error code otherwise
716+
* @return 0 or an error code
717717
*/
718718
GIT_EXTERN(int) git_index_find_prefix(size_t *at_pos, git_index *index, const char *prefix);
719719

include/git2/indexer.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ typedef struct git_indexer_progress {
5151
* Type for progress callbacks during indexing. Return a value less
5252
* than zero to cancel the indexing or download.
5353
*
54-
* @param stats Structure containing information about the state of the tran sfer
54+
* @param stats Structure containing information about the state of the transfer
5555
* @param payload Payload provided by caller
5656
*/
5757
typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload);
@@ -64,6 +64,7 @@ typedef struct git_indexer_options {
6464

6565
/** progress_cb function to call with progress information */
6666
git_indexer_progress_cb progress_cb;
67+
6768
/** progress_cb_payload payload for the progress callback */
6869
void *progress_cb_payload;
6970

include/git2/tree.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -334,6 +334,7 @@ GIT_EXTERN(int) git_treebuilder_insert(
334334
*
335335
* @param bld Tree builder
336336
* @param filename Filename of the entry to remove
337+
* @return 0 or an error code
337338
*/
338339
GIT_EXTERN(int) git_treebuilder_remove(
339340
git_treebuilder *bld, const char *filename);
@@ -463,6 +464,7 @@ typedef struct {
463464
* @param baseline the tree to base these changes on
464465
* @param nupdates the number of elements in the update list
465466
* @param updates the list of updates to perform
467+
* @return 0 or an error code
466468
*/
467469
GIT_EXTERN(int) git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates);
468470

src/odb.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -297,14 +297,15 @@ int git_odb__hashlink(git_oid *out, const char *path)
297297
GIT_ERROR_CHECK_ALLOC(link_data);
298298

299299
read_len = p_readlink(path, link_data, size);
300-
link_data[size] = '\0';
301-
if (read_len != size) {
300+
if (read_len == -1) {
302301
git_error_set(GIT_ERROR_OS, "failed to read symlink data for '%s'", path);
303302
git__free(link_data);
304303
return -1;
305304
}
305+
GIT_ASSERT(read_len <= size);
306+
link_data[read_len] = '\0';
306307

307-
result = git_odb_hash(out, link_data, size, GIT_OBJECT_BLOB);
308+
result = git_odb_hash(out, link_data, read_len, GIT_OBJECT_BLOB);
308309
git__free(link_data);
309310
} else {
310311
int fd = git_futils_open_ro(path);

src/transports/winhttp.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,10 @@
5252
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_3 0x00002000
5353
#endif
5454

55+
#ifndef WINHTTP_NO_CLIENT_CERT_CONTEXT
56+
# define WINHTTP_NO_CLIENT_CERT_CONTEXT NULL
57+
#endif
58+
5559
#ifndef HTTP_STATUS_PERMANENT_REDIRECT
5660
# define HTTP_STATUS_PERMANENT_REDIRECT 308
5761
#endif

0 commit comments

Comments
 (0)