Skip to content

Commit c4c95bf

Browse files
authored
Merge pull request libgit2#4287 from AndreyG/reset/interface-cosmetics
git_reset_*: pass parameters as const pointers
2 parents 0e16568 + d4e03be commit c4c95bf

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

include/git2/reset.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ typedef enum {
6161
*/
6262
GIT_EXTERN(int) git_reset(
6363
git_repository *repo,
64-
git_object *target,
64+
const git_object *target,
6565
git_reset_t reset_type,
6666
const git_checkout_options *checkout_opts);
6767

@@ -79,7 +79,7 @@ GIT_EXTERN(int) git_reset(
7979
*/
8080
GIT_EXTERN(int) git_reset_from_annotated(
8181
git_repository *repo,
82-
git_annotated_commit *commit,
82+
const git_annotated_commit *commit,
8383
git_reset_t reset_type,
8484
const git_checkout_options *checkout_opts);
8585

@@ -103,8 +103,8 @@ GIT_EXTERN(int) git_reset_from_annotated(
103103
*/
104104
GIT_EXTERN(int) git_reset_default(
105105
git_repository *repo,
106-
git_object *target,
107-
git_strarray* pathspecs);
106+
const git_object *target,
107+
const git_strarray* pathspecs);
108108

109109
/** @} */
110110
GIT_END_DECL

src/reset.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@
2020

2121
int git_reset_default(
2222
git_repository *repo,
23-
git_object *target,
24-
git_strarray* pathspecs)
23+
const git_object *target,
24+
const git_strarray* pathspecs)
2525
{
2626
git_object *commit = NULL;
2727
git_tree *tree = NULL;
@@ -100,7 +100,7 @@ int git_reset_default(
100100

101101
static int reset(
102102
git_repository *repo,
103-
git_object *target,
103+
const git_object *target,
104104
const char *to,
105105
git_reset_t reset_type,
106106
const git_checkout_options *checkout_opts)
@@ -182,7 +182,7 @@ static int reset(
182182

183183
int git_reset(
184184
git_repository *repo,
185-
git_object *target,
185+
const git_object *target,
186186
git_reset_t reset_type,
187187
const git_checkout_options *checkout_opts)
188188
{
@@ -191,7 +191,7 @@ int git_reset(
191191

192192
int git_reset_from_annotated(
193193
git_repository *repo,
194-
git_annotated_commit *commit,
194+
const git_annotated_commit *commit,
195195
git_reset_t reset_type,
196196
const git_checkout_options *checkout_opts)
197197
{

0 commit comments

Comments
 (0)