summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Good <alex@memoryandthought.me>2021-06-30 12:59:48 +0100
committerAlex Good <alex@memoryandthought.me>2021-06-30 12:59:48 +0100
commit39fd7646cbb7cdc41c4f6810ca69ed234307fe10 (patch)
treeee0d38b4bb2849921ffd3a34969a9c0beb453e03
parent8ad5998f9a150cdaf7d5d39bd1b008354bb4c1fe (diff)
parente16747660f0d21928d2abaa49ac0657c6664f157 (diff)
downloadlibgit2-39fd7646cbb7cdc41c4f6810ca69ed234307fe10.tar.gz
Merge branch 'main' into respect-force-flag-in-remote-fetch
-rw-r--r--README.md3
-rw-r--r--docs/contributing.md8
-rw-r--r--docs/release.md6
-rw-r--r--include/git2/apply.h2
-rw-r--r--include/git2/common.h5
-rw-r--r--include/git2/index.h4
-rw-r--r--include/git2/indexer.h3
-rw-r--r--include/git2/tree.h2
-rw-r--r--src/odb.c7
-rw-r--r--src/transports/winhttp.c4
10 files changed, 30 insertions, 14 deletions
diff --git a/README.md b/README.md
index b8448be88..aa642549d 100644
--- a/README.md
+++ b/README.md
@@ -104,7 +104,8 @@ Getting Help
**Chat with us**
-- via IRC: join [#libgit2](https://webchat.freenode.net/#libgit2) on Freenode
+- via IRC: join [#libgit2](https://web.libera.chat/#libgit2) on
+ [libera](https://libera.chat).
- via Slack: visit [slack.libgit2.org](http://slack.libgit2.org/) to sign up,
then join us in `#libgit2`
diff --git a/docs/contributing.md b/docs/contributing.md
index 21e42b1d9..a6eca3d15 100644
--- a/docs/contributing.md
+++ b/docs/contributing.md
@@ -35,7 +35,7 @@ easily accessible permanent record of the conversation.
## Libgit2 Versions
-The `master` branch is the main branch where development happens.
+The `main` branch is the main branch where development happens.
Releases are tagged
(e.g. [v0.21.0](https://github.com/libgit2/libgit2/releases/tag/v0.21.0) )
and when a critical bug fix needs to be backported, it will be done on a
@@ -51,7 +51,7 @@ commit SHA
Using [`git describe`](http://git-scm.com/docs/git-describe) is a
great way to tell us what version you're working with.
-If you're not running against the latest `master` branch version,
+If you're not running against the latest `main` branch version,
please compile and test against that to avoid re-reporting an issue that's
already been fixed.
@@ -68,11 +68,11 @@ flow](https://guides.github.com/introduction/flow/index.html), where
contributors fork the [libgit2 repository](https://github.com/libgit2/libgit2),
make their changes on branch, and submit a
[Pull Request](https://help.github.com/articles/using-pull-requests)
-(a.k.a. "PR"). Pull requests should usually be targeted at the `master`
+(a.k.a. "PR"). Pull requests should usually be targeted at the `main`
branch.
Life will be a lot easier for you (and us) if you follow this pattern
-(i.e. fork, named branch, submit PR). If you use your fork's `master`
+(i.e. fork, named branch, submit PR). If you use your fork's `main`
branch directly, things can get messy.
Please include a nice description of your changes when you submit your PR;
diff --git a/docs/release.md b/docs/release.md
index 22b35ede7..3200c4449 100644
--- a/docs/release.md
+++ b/docs/release.md
@@ -1,6 +1,6 @@
# Releasing the library
-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.
+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.
## Full release
@@ -40,7 +40,7 @@ followed by the three sections in the changelog. For release candidates we can a
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.
-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.
+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.
## Maintenance release
@@ -76,7 +76,7 @@ We use docurium to generate our documentation. It is a tool written in ruby whic
gem install docurium
-and run it against our description file with the tip of master checked out.
+and run it against our description file with the tip of `main` checked out.
cm doc api.docurium
diff --git a/include/git2/apply.h b/include/git2/apply.h
index b248eaafe..bc637df1c 100644
--- a/include/git2/apply.h
+++ b/include/git2/apply.h
@@ -100,6 +100,7 @@ GIT_EXTERN(int) git_apply_options_init(git_apply_options *opts, unsigned int ver
* @param preimage the tree to apply the diff to
* @param diff the diff to apply
* @param options the options for the apply (or null for defaults)
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_apply_to_tree(
git_index **out,
@@ -137,6 +138,7 @@ typedef enum {
* @param diff the diff to apply
* @param location the location to apply (workdir, index or both)
* @param options the options for the apply (or null for defaults)
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_apply(
git_repository *repo,
diff --git a/include/git2/common.h b/include/git2/common.h
index 8dd30d506..dee260e05 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -356,6 +356,11 @@ typedef enum {
* >
* > - `ciphers` is the list of ciphers that are eanbled.
*
+ * * opts(GIT_OPT_GET_USER_AGENT, git_buf *out)
+ *
+ * > Get the value of the User-Agent header.
+ * > The User-Agent is written to the `out` buffer.
+ *
* * opts(GIT_OPT_ENABLE_OFS_DELTA, int enabled)
*
* > Enable or disable the use of "offset deltas" when creating packfiles,
diff --git a/include/git2/index.h b/include/git2/index.h
index 14a132497..532a52091 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -702,7 +702,7 @@ GIT_EXTERN(int) git_index_update_all(
* @param at_pos the address to which the position of the index entry is written (optional)
* @param index an existing index object
* @param path path to search
- * @return a zero-based position in the index if found; GIT_ENOTFOUND otherwise
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *path);
@@ -713,7 +713,7 @@ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *pat
* @param at_pos the address to which the position of the index entry is written (optional)
* @param index an existing index object
* @param prefix the prefix to search for
- * @return 0 with valid value in at_pos; an error code otherwise
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_index_find_prefix(size_t *at_pos, git_index *index, const char *prefix);
diff --git a/include/git2/indexer.h b/include/git2/indexer.h
index 8059e4db3..a434d243f 100644
--- a/include/git2/indexer.h
+++ b/include/git2/indexer.h
@@ -51,7 +51,7 @@ typedef struct git_indexer_progress {
* Type for progress callbacks during indexing. Return a value less
* than zero to cancel the indexing or download.
*
- * @param stats Structure containing information about the state of the tran sfer
+ * @param stats Structure containing information about the state of the transfer
* @param payload Payload provided by caller
*/
typedef int GIT_CALLBACK(git_indexer_progress_cb)(const git_indexer_progress *stats, void *payload);
@@ -64,6 +64,7 @@ typedef struct git_indexer_options {
/** progress_cb function to call with progress information */
git_indexer_progress_cb progress_cb;
+
/** progress_cb_payload payload for the progress callback */
void *progress_cb_payload;
diff --git a/include/git2/tree.h b/include/git2/tree.h
index d7545ace9..f2289fc7e 100644
--- a/include/git2/tree.h
+++ b/include/git2/tree.h
@@ -334,6 +334,7 @@ GIT_EXTERN(int) git_treebuilder_insert(
*
* @param bld Tree builder
* @param filename Filename of the entry to remove
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_treebuilder_remove(
git_treebuilder *bld, const char *filename);
@@ -463,6 +464,7 @@ typedef struct {
* @param baseline the tree to base these changes on
* @param nupdates the number of elements in the update list
* @param updates the list of updates to perform
+ * @return 0 or an error code
*/
GIT_EXTERN(int) git_tree_create_updated(git_oid *out, git_repository *repo, git_tree *baseline, size_t nupdates, const git_tree_update *updates);
diff --git a/src/odb.c b/src/odb.c
index 1b91434bf..7625ce6e3 100644
--- a/src/odb.c
+++ b/src/odb.c
@@ -297,14 +297,15 @@ int git_odb__hashlink(git_oid *out, const char *path)
GIT_ERROR_CHECK_ALLOC(link_data);
read_len = p_readlink(path, link_data, size);
- link_data[size] = '\0';
- if (read_len != size) {
+ if (read_len == -1) {
git_error_set(GIT_ERROR_OS, "failed to read symlink data for '%s'", path);
git__free(link_data);
return -1;
}
+ GIT_ASSERT(read_len <= size);
+ link_data[read_len] = '\0';
- result = git_odb_hash(out, link_data, size, GIT_OBJECT_BLOB);
+ result = git_odb_hash(out, link_data, read_len, GIT_OBJECT_BLOB);
git__free(link_data);
} else {
int fd = git_futils_open_ro(path);
diff --git a/src/transports/winhttp.c b/src/transports/winhttp.c
index 97ceab2d4..d21c50651 100644
--- a/src/transports/winhttp.c
+++ b/src/transports/winhttp.c
@@ -52,6 +52,10 @@
# define WINHTTP_FLAG_SECURE_PROTOCOL_TLS1_3 0x00002000
#endif
+#ifndef WINHTTP_NO_CLIENT_CERT_CONTEXT
+# define WINHTTP_NO_CLIENT_CERT_CONTEXT NULL
+#endif
+
#ifndef HTTP_STATUS_PERMANENT_REDIRECT
# define HTTP_STATUS_PERMANENT_REDIRECT 308
#endif