merge_driver: fix const-correctness for source getters
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74
diff --git a/include/git2/sys/merge.h b/include/git2/sys/merge.h
index 0319410..eed106c 100644
--- a/include/git2/sys/merge.h
+++ b/include/git2/sys/merge.h
@@ -36,23 +36,23 @@ GIT_EXTERN(git_merge_driver *) git_merge_driver_lookup(const char *name);
typedef struct git_merge_driver_source git_merge_driver_source;
/** Get the repository that the source data is coming from. */
-GIT_EXTERN(git_repository *) git_merge_driver_source_repo(
+GIT_EXTERN(const git_repository *) git_merge_driver_source_repo(
const git_merge_driver_source *src);
/** Gets the ancestor of the file to merge. */
-GIT_EXTERN(git_index_entry *) git_merge_driver_source_ancestor(
+GIT_EXTERN(const git_index_entry *) git_merge_driver_source_ancestor(
const git_merge_driver_source *src);
/** Gets the ours side of the file to merge. */
-GIT_EXTERN(git_index_entry *) git_merge_driver_source_ours(
+GIT_EXTERN(const git_index_entry *) git_merge_driver_source_ours(
const git_merge_driver_source *src);
/** Gets the theirs side of the file to merge. */
-GIT_EXTERN(git_index_entry *) git_merge_driver_source_theirs(
+GIT_EXTERN(const git_index_entry *) git_merge_driver_source_theirs(
const git_merge_driver_source *src);
/** Gets the merge file options that the merge was invoked with */
-GIT_EXTERN(git_merge_file_options *) git_merge_driver_source_file_options(
+GIT_EXTERN(const git_merge_file_options *) git_merge_driver_source_file_options(
const git_merge_driver_source *src);
diff --git a/src/merge_driver.c b/src/merge_driver.c
index 5ee0b38..0f35d23 100644
--- a/src/merge_driver.c
+++ b/src/merge_driver.c
@@ -32,31 +32,31 @@ static struct merge_driver_registry merge_driver_registry;
static void git_merge_driver_global_shutdown(void);
-git_repository* git_merge_driver_source_repo(const git_merge_driver_source *src)
+const git_repository* git_merge_driver_source_repo(const git_merge_driver_source *src)
{
assert(src);
return src->repo;
}
-git_index_entry* git_merge_driver_source_ancestor(const git_merge_driver_source *src)
+const git_index_entry* git_merge_driver_source_ancestor(const git_merge_driver_source *src)
{
assert(src);
return src->ancestor;
}
-git_index_entry* git_merge_driver_source_ours(const git_merge_driver_source *src)
+const git_index_entry* git_merge_driver_source_ours(const git_merge_driver_source *src)
{
assert(src);
return src->ours;
}
-git_index_entry* git_merge_driver_source_theirs(const git_merge_driver_source *src)
+const git_index_entry* git_merge_driver_source_theirs(const git_merge_driver_source *src)
{
assert(src);
return src->theirs;
}
-git_merge_file_options* git_merge_driver_source_file_options(const git_merge_driver_source *src)
+const git_merge_file_options* git_merge_driver_source_file_options(const git_merge_driver_source *src)
{
assert(src);
return src->file_opts;