Skip to content

Commit fc9d289

Browse files
stash: add const to arguments
1 parent d0155f1 commit fc9d289

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

include/git2/stash.h

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,9 @@ GIT_EXTERN(int) git_stash_save_options_init(
133133
* or error code.
134134
*/
135135
GIT_EXTERN(int) git_stash_save_with_opts(
136-
git_oid *out, git_repository *repo, git_stash_save_options *opts);
136+
git_oid *out,
137+
git_repository *repo,
138+
const git_stash_save_options *opts);
137139

138140
/** Stash application flags. */
139141
typedef enum {

src/libgit2/stash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -196,7 +196,7 @@ static int stash_to_index(
196196
static int stash_update_index_from_paths(
197197
git_repository *repo,
198198
git_index *index,
199-
git_strarray *paths)
199+
const git_strarray *paths)
200200
{
201201
unsigned int status_flags;
202202
size_t i, error = 0;
@@ -420,7 +420,7 @@ static int build_stash_commit_from_tree(
420420
git_commit *i_commit,
421421
git_commit *b_commit,
422422
git_commit *u_commit,
423-
git_tree *tree)
423+
const git_tree *tree)
424424
{
425425
const git_commit *parents[] = { NULL, NULL, NULL };
426426

@@ -613,7 +613,7 @@ static int has_changes_cb(const char *path, unsigned int status, void *payload)
613613
static int ensure_there_are_changes_to_stash_paths(
614614
git_repository *repo,
615615
uint32_t flags,
616-
git_strarray *paths)
616+
const git_strarray *paths)
617617
{
618618
int error;
619619
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
@@ -674,7 +674,7 @@ int git_stash_save(
674674
}
675675

676676
int git_stash_save_with_opts(
677-
git_oid *out, git_repository *repo, git_stash_save_options *opts)
677+
git_oid *out, git_repository *repo, const git_stash_save_options *opts)
678678
{
679679
git_index *index = NULL, *paths_index = NULL;
680680
git_commit *b_commit = NULL, *i_commit = NULL, *u_commit = NULL;

0 commit comments

Comments
 (0)