summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJacob Watson <gary.kactara.email@gmail.com>2022-07-13 15:58:52 -0700
committerJacob Watson <gary.kactara.email@gmail.com>2022-07-14 10:24:00 -0700
commitfc9d28970a9fe970025f529c2108a6a3fef03555 (patch)
tree053a7f136966bfa067c4659a8d4fd9edec2d7ed3
parentd0155f1089113bb022aa614254b15a7e1ffcd4a2 (diff)
downloadlibgit2-fc9d28970a9fe970025f529c2108a6a3fef03555.tar.gz
stash: add `const` to arguments
-rw-r--r--include/git2/stash.h4
-rw-r--r--src/libgit2/stash.c8
2 files changed, 7 insertions, 5 deletions
diff --git a/include/git2/stash.h b/include/git2/stash.h
index 3b8908195..3d70b36c3 100644
--- a/include/git2/stash.h
+++ b/include/git2/stash.h
@@ -133,7 +133,9 @@ GIT_EXTERN(int) git_stash_save_options_init(
* or error code.
*/
GIT_EXTERN(int) git_stash_save_with_opts(
- git_oid *out, git_repository *repo, git_stash_save_options *opts);
+ git_oid *out,
+ git_repository *repo,
+ const git_stash_save_options *opts);
/** Stash application flags. */
typedef enum {
diff --git a/src/libgit2/stash.c b/src/libgit2/stash.c
index d801a04ee..af65aae3c 100644
--- a/src/libgit2/stash.c
+++ b/src/libgit2/stash.c
@@ -196,7 +196,7 @@ static int stash_to_index(
static int stash_update_index_from_paths(
git_repository *repo,
git_index *index,
- git_strarray *paths)
+ const git_strarray *paths)
{
unsigned int status_flags;
size_t i, error = 0;
@@ -420,7 +420,7 @@ static int build_stash_commit_from_tree(
git_commit *i_commit,
git_commit *b_commit,
git_commit *u_commit,
- git_tree *tree)
+ const git_tree *tree)
{
const git_commit *parents[] = { NULL, NULL, NULL };
@@ -613,7 +613,7 @@ static int has_changes_cb(const char *path, unsigned int status, void *payload)
static int ensure_there_are_changes_to_stash_paths(
git_repository *repo,
uint32_t flags,
- git_strarray *paths)
+ const git_strarray *paths)
{
int error;
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
@@ -674,7 +674,7 @@ int git_stash_save(
}
int git_stash_save_with_opts(
- git_oid *out, git_repository *repo, git_stash_save_options *opts)
+ git_oid *out, git_repository *repo, const git_stash_save_options *opts)
{
git_index *index = NULL, *paths_index = NULL;
git_commit *b_commit = NULL, *i_commit = NULL, *u_commit = NULL;