diff options
| author | Jacques Germishuys <jacquesg@striata.com> | 2014-04-03 15:50:21 +0200 |
|---|---|---|
| committer | Jacques Germishuys <jacquesg@striata.com> | 2014-04-03 16:06:31 +0200 |
| commit | 3b4ba2787049c561cd7a9e3fea8fc16e473a0b32 (patch) | |
| tree | 14f1ba819d09fce9872eb31db424b30274447d02 /src | |
| parent | fd61f05ea605155ed9e56bfad0e804c6718e0611 (diff) | |
| download | libgit2-3b4ba2787049c561cd7a9e3fea8fc16e473a0b32.tar.gz | |
Const correctness!
Diffstat (limited to 'src')
| -rw-r--r-- | src/blob.c | 2 | ||||
| -rw-r--r-- | src/branch.c | 8 | ||||
| -rw-r--r-- | src/index.c | 2 | ||||
| -rw-r--r-- | src/merge.c | 2 | ||||
| -rw-r--r-- | src/push.c | 2 | ||||
| -rw-r--r-- | src/refs.c | 12 |
6 files changed, 16 insertions, 12 deletions
diff --git a/src/blob.c b/src/blob.c index faf8a4a99..0aa2516db 100644 --- a/src/blob.c +++ b/src/blob.c @@ -326,7 +326,7 @@ cleanup: return error; } -int git_blob_is_binary(git_blob *blob) +int git_blob_is_binary(const git_blob *blob) { git_buf content; diff --git a/src/branch.c b/src/branch.c index df665a469..63c6ec110 100644 --- a/src/branch.c +++ b/src/branch.c @@ -281,7 +281,9 @@ int git_branch_lookup( return retrieve_branch_reference(ref_out, repo, branch_name, branch_type == GIT_BRANCH_REMOTE); } -int git_branch_name(const char **out, git_reference *ref) +int git_branch_name( + const char **out, + const git_reference *ref) { const char *branch_name; @@ -450,8 +452,8 @@ cleanup: } int git_branch_upstream( - git_reference **tracking_out, - git_reference *branch) + git_reference **tracking_out, + const git_reference *branch) { int error; git_buf tracking_name = GIT_BUF_INIT; diff --git a/src/index.c b/src/index.c index ea0815e4c..3fcd21115 100644 --- a/src/index.c +++ b/src/index.c @@ -553,7 +553,7 @@ int git_index_write(git_index *index) return 0; } -const char * git_index_path(git_index *index) +const char * git_index_path(const git_index *index) { assert(index); return index->index_file_path; diff --git a/src/merge.c b/src/merge.c index f9ed7b0a3..dd6a39f37 100644 --- a/src/merge.c +++ b/src/merge.c @@ -2695,7 +2695,7 @@ static int merge_head_init( int git_merge_head_from_ref( git_merge_head **out, git_repository *repo, - git_reference *ref) + const git_reference *ref) { git_reference *resolved; int error = 0; diff --git a/src/push.c b/src/push.c index 521355621..5c8de3339 100644 --- a/src/push.c +++ b/src/push.c @@ -651,7 +651,7 @@ int git_push_finish(git_push *push) return 0; } -int git_push_unpack_ok(git_push *push) +int git_push_unpack_ok(const git_push *push) { return push->unpack_ok; } diff --git a/src/refs.c b/src/refs.c index 8b6e09a33..9428f617d 100644 --- a/src/refs.c +++ b/src/refs.c @@ -1031,7 +1031,9 @@ int git_reference__normalize_name_lax( } #define GIT_REF_TYPEMASK (GIT_REF_OID | GIT_REF_SYMBOLIC) -int git_reference_cmp(git_reference *ref1, git_reference *ref2) +int git_reference_cmp( + const git_reference *ref1, + const git_reference *ref2) { git_ref_t type1, type2; assert(ref1 && ref2); @@ -1148,7 +1150,7 @@ int git_reference__is_remote(const char *ref_name) return git__prefixcmp(ref_name, GIT_REFS_REMOTES_DIR) == 0; } -int git_reference_is_remote(git_reference *ref) +int git_reference_is_remote(const git_reference *ref) { assert(ref); return git_reference__is_remote(ref->name); @@ -1159,7 +1161,7 @@ int git_reference__is_tag(const char *ref_name) return git__prefixcmp(ref_name, GIT_REFS_TAGS_DIR) == 0; } -int git_reference_is_tag(git_reference *ref) +int git_reference_is_tag(const git_reference *ref) { assert(ref); return git_reference__is_tag(ref->name); @@ -1170,7 +1172,7 @@ int git_reference__is_note(const char *ref_name) return git__prefixcmp(ref_name, GIT_REFS_NOTES_DIR) == 0; } -int git_reference_is_note(git_reference *ref) +int git_reference_is_note(const git_reference *ref) { assert(ref); return git_reference__is_note(ref->name); @@ -1244,7 +1246,7 @@ int git_reference_is_valid_name(const char *refname) return git_reference__is_valid_name(refname, GIT_REF_FORMAT_ALLOW_ONELEVEL); } -const char *git_reference_shorthand(git_reference *ref) +const char *git_reference_shorthand(const git_reference *ref) { const char *name = ref->name; |
