Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 3f4182d

Browse files
authored
Merge pull request #6936 from libgit2/ethomson/v1.8.4
libgit2 v1.8.4
2 parents 3353f78 + 73644b3 commit 3f4182d

File tree

21 files changed

+55
-37
lines changed

21 files changed

+55
-37
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
cmake_minimum_required(VERSION 3.5.1)
88

9-
project(libgit2 VERSION "1.8.3" LANGUAGES C)
9+
project(libgit2 VERSION "1.8.4" LANGUAGES C)
1010

1111
# Add find modules to the path
1212
set(CMAKE_MODULE_PATH ${CMAKE_MODULE_PATH} "${PROJECT_SOURCE_DIR}/cmake")

docs/changelog.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,18 @@
1+
v1.8.4
2+
------
3+
4+
We erroneously shipped v1.8.3 without actually including the change
5+
in v1.8.2. This release re-re-introduces the pre-v1.8.0 `commit`
6+
constness behavior.
7+
8+
## What's Changed
9+
10+
### Bug fixes
11+
12+
* Fix constness issue introduced in #6716 by @ethomson in https://github.com/libgit2/libgit2/pull/6829
13+
14+
**Full Changelog**: https://github.com/libgit2/libgit2/compare/v1.8.3...v1.8.4
15+
116
v1.8.3
217
------
318

examples/merge.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -263,7 +263,7 @@ static int create_merge_commit(git_repository *repo, git_index *index, struct me
263263
sign, sign,
264264
NULL, msg,
265265
tree,
266-
opts->annotated_count + 1, parents);
266+
opts->annotated_count + 1, (const git_commit **)parents);
267267
check_lg2(err, "failed to create commit", NULL);
268268

269269
/* We're done merging, cleanup the repository state */

include/git2/commit.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -366,7 +366,7 @@ GIT_EXTERN(int) git_commit_create(
366366
const char *message,
367367
const git_tree *tree,
368368
size_t parent_count,
369-
git_commit * const parents[]);
369+
const git_commit *parents[]);
370370

371371
/**
372372
* Create new commit in the repository using a variable argument list.
@@ -512,7 +512,7 @@ GIT_EXTERN(int) git_commit_create_buffer(
512512
const char *message,
513513
const git_tree *tree,
514514
size_t parent_count,
515-
git_commit * const parents[]);
515+
const git_commit *parents[]);
516516

517517
/**
518518
* Create a commit object from the given buffer and signature
@@ -581,7 +581,7 @@ typedef int (*git_commit_create_cb)(
581581
const char *message,
582582
const git_tree *tree,
583583
size_t parent_count,
584-
git_commit * const parents[],
584+
const git_commit *parents[],
585585
void *payload);
586586

587587
/** An array of commits returned from the library */

include/git2/version.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
* The version string for libgit2. This string follows semantic
1212
* versioning (v2) guidelines.
1313
*/
14-
#define LIBGIT2_VERSION "1.8.3"
14+
#define LIBGIT2_VERSION "1.8.4"
1515

1616
/** The major version number for this version of libgit2. */
1717
#define LIBGIT2_VER_MAJOR 1
@@ -20,7 +20,7 @@
2020
#define LIBGIT2_VER_MINOR 8
2121

2222
/** The revision ("teeny") version number for this version of libgit2. */
23-
#define LIBGIT2_VER_REVISION 3
23+
#define LIBGIT2_VER_REVISION 4
2424

2525
/** The Windows DLL patch number for this version of libgit2. */
2626
#define LIBGIT2_VER_PATCH 0

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "libgit2",
3-
"version": "1.8.3",
3+
"version": "1.8.4",
44
"repo": "https://github.com/libgit2/libgit2",
55
"description": " A cross-platform, linkable library implementation of Git that you can use in your application.",
66
"install": "mkdir build && cd build && cmake .. && cmake --build ."

src/libgit2/commit.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ int git_commit_create_from_ids(
281281

282282
typedef struct {
283283
size_t total;
284-
git_commit * const *parents;
284+
const git_commit **parents;
285285
git_repository *repo;
286286
} commit_parent_data;
287287

@@ -307,7 +307,7 @@ int git_commit_create(
307307
const char *message,
308308
const git_tree *tree,
309309
size_t parent_count,
310-
git_commit * const parents[])
310+
const git_commit *parents[])
311311
{
312312
commit_parent_data data = { parent_count, parents, repo };
313313

@@ -945,7 +945,7 @@ int git_commit_create_buffer(
945945
const char *message,
946946
const git_tree *tree,
947947
size_t parent_count,
948-
git_commit * const parents[])
948+
const git_commit *parents[])
949949
{
950950
GIT_BUF_WRAP_PRIVATE(out, git_commit__create_buffer, repo,
951951
author, committer, message_encoding, message,
@@ -961,7 +961,7 @@ int git_commit__create_buffer(
961961
const char *message,
962962
const git_tree *tree,
963963
size_t parent_count,
964-
git_commit * const parents[])
964+
const git_commit *parents[])
965965
{
966966
int error;
967967
commit_parent_data data = { parent_count, parents, repo };
@@ -1150,7 +1150,8 @@ int git_commit_create_from_stage(
11501150

11511151
error = git_commit_create(out, repo, "HEAD", author, committer,
11521152
opts.message_encoding, message,
1153-
tree, parents.count, parents.commits);
1153+
tree, parents.count,
1154+
(const git_commit **)parents.commits);
11541155

11551156
done:
11561157
git_commitarray_dispose(&parents);

src/libgit2/commit.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ int git_commit__create_buffer(
6464
const char *message,
6565
const git_tree *tree,
6666
size_t parent_count,
67-
git_commit * const parents[]);
67+
const git_commit *parents[]);
6868

6969
int git_commit__parse(
7070
void *commit,

src/libgit2/notes.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -303,7 +303,7 @@ static int note_write(
303303

304304
error = git_commit_create(&oid, repo, notes_ref, author, committer,
305305
NULL, GIT_NOTES_DEFAULT_MSG_ADD,
306-
tree, *parents == NULL ? 0 : 1, parents);
306+
tree, *parents == NULL ? 0 : 1, (const git_commit **) parents);
307307

308308
if (notes_commit_out)
309309
git_oid_cpy(notes_commit_out, &oid);
@@ -394,7 +394,7 @@ static int note_remove(
394394
NULL, GIT_NOTES_DEFAULT_MSG_RM,
395395
tree_after_removal,
396396
*parents == NULL ? 0 : 1,
397-
parents);
397+
(const git_commit **) parents);
398398

399399
if (error < 0)
400400
goto cleanup;

src/libgit2/rebase.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -952,7 +952,7 @@ static int create_signed(
952952
const char *message,
953953
git_tree *tree,
954954
size_t parent_count,
955-
git_commit * const *parents)
955+
const git_commit **parents)
956956
{
957957
git_str commit_content = GIT_STR_INIT;
958958
git_buf commit_signature = { NULL, 0, 0 },
@@ -1040,7 +1040,8 @@ static int rebase_commit__create(
10401040
if (rebase->options.commit_create_cb) {
10411041
error = rebase->options.commit_create_cb(&commit_id,
10421042
author, committer, message_encoding, message,
1043-
tree, 1, &parent_commit, rebase->options.payload);
1043+
tree, 1, (const git_commit **)&parent_commit,
1044+
rebase->options.payload);
10441045

10451046
git_error_set_after_callback_function(error,
10461047
"commit_create_cb");
@@ -1049,14 +1050,14 @@ static int rebase_commit__create(
10491050
else if (rebase->options.signing_cb) {
10501051
error = create_signed(&commit_id, rebase, author,
10511052
committer, message_encoding, message, tree,
1052-
1, &parent_commit);
1053+
1, (const git_commit **)&parent_commit);
10531054
}
10541055
#endif
10551056

10561057
if (error == GIT_PASSTHROUGH)
10571058
error = git_commit_create(&commit_id, rebase->repo, NULL,
10581059
author, committer, message_encoding, message,
1059-
tree, 1, &parent_commit);
1060+
tree, 1, (const git_commit **)&parent_commit);
10601061

10611062
if (error)
10621063
goto done;

0 commit comments

Comments
 (0)