Skip to content

Commit f2befe8

Browse files
stash: add const to arguments
1 parent ec67f95 commit f2befe8

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/stash.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ static int stash_to_index(
197197
static int stash_update_index_from_paths(
198198
git_repository *repo,
199199
git_index *index,
200-
git_strarray *paths)
200+
const git_strarray *paths)
201201
{
202202
unsigned int status_flags;
203203
size_t i;
@@ -422,7 +422,7 @@ static int build_stash_commit_from_tree(
422422
git_commit *i_commit,
423423
git_commit *b_commit,
424424
git_commit *u_commit,
425-
git_tree *tree)
425+
const git_tree *tree)
426426
{
427427
const git_commit *parents[] = { NULL, NULL, NULL };
428428

@@ -615,7 +615,7 @@ static int has_changes_cb(const char *path, unsigned int status, void *payload)
615615
static int ensure_there_are_changes_to_stash_paths(
616616
git_repository *repo,
617617
uint32_t flags,
618-
git_strarray *paths)
618+
const git_strarray *paths)
619619
{
620620
int error;
621621
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
@@ -676,7 +676,7 @@ int git_stash_save(
676676
}
677677

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

0 commit comments

Comments
 (0)