summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorJacques Germishuys <jacquesg@striata.com>2014-04-03 15:50:21 +0200
committerJacques Germishuys <jacquesg@striata.com>2014-04-03 16:06:31 +0200
commit3b4ba2787049c561cd7a9e3fea8fc16e473a0b32 (patch)
tree14f1ba819d09fce9872eb31db424b30274447d02 /include/git2
parentfd61f05ea605155ed9e56bfad0e804c6718e0611 (diff)
downloadlibgit2-3b4ba2787049c561cd7a9e3fea8fc16e473a0b32.tar.gz
Const correctness!
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/blob.h2
-rw-r--r--include/git2/branch.h7
-rw-r--r--include/git2/index.h2
-rw-r--r--include/git2/merge.h2
-rw-r--r--include/git2/push.h2
-rw-r--r--include/git2/refs.h12
6 files changed, 15 insertions, 12 deletions
diff --git a/include/git2/blob.h b/include/git2/blob.h
index ac4d84392..1b6583309 100644
--- a/include/git2/blob.h
+++ b/include/git2/blob.h
@@ -216,7 +216,7 @@ GIT_EXTERN(int) git_blob_create_frombuffer(
* @return 1 if the content of the blob is detected
* as binary; 0 otherwise.
*/
-GIT_EXTERN(int) git_blob_is_binary(git_blob *blob);
+GIT_EXTERN(int) git_blob_is_binary(const git_blob *blob);
/** @} */
GIT_END_DECL
diff --git a/include/git2/branch.h b/include/git2/branch.h
index d2762019b..ad2a70b1f 100644
--- a/include/git2/branch.h
+++ b/include/git2/branch.h
@@ -179,8 +179,9 @@ GIT_EXTERN(int) git_branch_lookup(
* @return 0 on success; otherwise an error code (e.g., if the
* ref is no local or remote branch).
*/
-GIT_EXTERN(int) git_branch_name(const char **out,
- git_reference *ref);
+GIT_EXTERN(int) git_branch_name(
+ const char **out,
+ const git_reference *ref);
/**
* Return the reference supporting the remote tracking branch,
@@ -196,7 +197,7 @@ GIT_EXTERN(int) git_branch_name(const char **out,
*/
GIT_EXTERN(int) git_branch_upstream(
git_reference **out,
- git_reference *branch);
+ const git_reference *branch);
/**
* Set the upstream configuration for a given local branch
diff --git a/include/git2/index.h b/include/git2/index.h
index 9a7ad28a6..dd6a28e40 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -255,7 +255,7 @@ GIT_EXTERN(int) git_index_write(git_index *index);
* @param index an existing index object
* @return path to index file or NULL for in-memory index
*/
-GIT_EXTERN(const char *) git_index_path(git_index *index);
+GIT_EXTERN(const char *) git_index_path(const git_index *index);
/**
* Read a tree into the index file with stats
diff --git a/include/git2/merge.h b/include/git2/merge.h
index 769df5a8d..6d97e81e6 100644
--- a/include/git2/merge.h
+++ b/include/git2/merge.h
@@ -341,7 +341,7 @@ GIT_EXTERN(int) git_merge_base_octopus(
GIT_EXTERN(int) git_merge_head_from_ref(
git_merge_head **out,
git_repository *repo,
- git_reference *ref);
+ const git_reference *ref);
/**
* Creates a `git_merge_head` from the given fetch head data. The resulting
diff --git a/include/git2/push.h b/include/git2/push.h
index 899d21e7f..7a8bec12c 100644
--- a/include/git2/push.h
+++ b/include/git2/push.h
@@ -148,7 +148,7 @@ GIT_EXTERN(int) git_push_finish(git_push *push);
*
* @return true if remote side successfully unpacked, false otherwise
*/
-GIT_EXTERN(int) git_push_unpack_ok(git_push *push);
+GIT_EXTERN(int) git_push_unpack_ok(const git_push *push);
/**
* Invoke callback `cb' on each status entry
diff --git a/include/git2/refs.h b/include/git2/refs.h
index 1bbb4ca46..6a1db65a8 100644
--- a/include/git2/refs.h
+++ b/include/git2/refs.h
@@ -487,7 +487,9 @@ GIT_EXTERN(void) git_reference_free(git_reference *ref);
* @param ref2 The second git_reference
* @return 0 if the same, else a stable but meaningless ordering.
*/
-GIT_EXTERN(int) git_reference_cmp(git_reference *ref1, git_reference *ref2);
+GIT_EXTERN(int) git_reference_cmp(
+ const git_reference *ref1,
+ const git_reference *ref2);
/**
* Create an iterator for the repo's references
@@ -596,7 +598,7 @@ GIT_EXTERN(int) git_reference_is_branch(const git_reference *ref);
* @return 1 when the reference lives in the refs/remotes
* namespace; 0 otherwise.
*/
-GIT_EXTERN(int) git_reference_is_remote(git_reference *ref);
+GIT_EXTERN(int) git_reference_is_remote(const git_reference *ref);
/**
* Check if a reference is a tag
@@ -606,7 +608,7 @@ GIT_EXTERN(int) git_reference_is_remote(git_reference *ref);
* @return 1 when the reference lives in the refs/tags
* namespace; 0 otherwise.
*/
-GIT_EXTERN(int) git_reference_is_tag(git_reference *ref);
+GIT_EXTERN(int) git_reference_is_tag(const git_reference *ref);
/**
* Check if a reference is a note
@@ -616,7 +618,7 @@ GIT_EXTERN(int) git_reference_is_tag(git_reference *ref);
* @return 1 when the reference lives in the refs/notes
* namespace; 0 otherwise.
*/
-GIT_EXTERN(int) git_reference_is_note(git_reference *ref);
+GIT_EXTERN(int) git_reference_is_note(const git_reference *ref);
typedef enum {
GIT_REF_FORMAT_NORMAL = 0u,
@@ -720,7 +722,7 @@ GIT_EXTERN(int) git_reference_is_valid_name(const char *refname);
* @param ref a reference
* @return the human-readable version of the name
*/
-GIT_EXTERN(const char *) git_reference_shorthand(git_reference *ref);
+GIT_EXTERN(const char *) git_reference_shorthand(const git_reference *ref);
/** @} */