summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2011-02-27 22:31:06 +0200
committerVicent Marti <tanoku@gmail.com>2011-03-03 20:23:50 +0200
commit17cdf25208202300def293ce1997b97aeb517586 (patch)
treee2a809524d3d2b21b6d13a668a0066a78ac8ada4 /src
parent2e60b652908a268a4333a6661e0fb95ccaeec1bc (diff)
downloadlibgit2-17cdf25208202300def293ce1997b97aeb517586.tar.gz
Make some Object methods take a const parameter
Signed-off-by: Vicent Marti <tanoku@gmail.com>
Diffstat (limited to 'src')
-rw-r--r--src/git2/object.h6
-rw-r--r--src/object.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/src/git2/object.h b/src/git2/object.h
index 084d11177..128c9faf5 100644
--- a/src/git2/object.h
+++ b/src/git2/object.h
@@ -66,7 +66,7 @@ GIT_EXTERN(int) git_object_write(git_object *object);
* @param obj the repository object
* @return the SHA1 id
*/
-GIT_EXTERN(const git_oid *) git_object_id(git_object *obj);
+GIT_EXTERN(const git_oid *) git_object_id(const git_object *obj);
/**
* Get the object type of an object
@@ -74,7 +74,7 @@ GIT_EXTERN(const git_oid *) git_object_id(git_object *obj);
* @param obj the repository object
* @return the object's type
*/
-GIT_EXTERN(git_otype) git_object_type(git_object *obj);
+GIT_EXTERN(git_otype) git_object_type(const git_object *obj);
/**
* Get the repository that owns this object
@@ -82,7 +82,7 @@ GIT_EXTERN(git_otype) git_object_type(git_object *obj);
* @param obj the object
* @return the repository who owns this object
*/
-GIT_EXTERN(git_repository *) git_object_owner(git_object *obj);
+GIT_EXTERN(git_repository *) git_object_owner(const git_object *obj);
/**
* Free a reference to one of the objects in the repository.
diff --git a/src/object.c b/src/object.c
index dd84cb5d7..c53a3acae 100644
--- a/src/object.c
+++ b/src/object.c
@@ -283,7 +283,7 @@ void git_object_free(git_object *object)
}
}
-const git_oid *git_object_id(git_object *obj)
+const git_oid *git_object_id(const git_object *obj)
{
assert(obj);
@@ -293,13 +293,13 @@ const git_oid *git_object_id(git_object *obj)
return &obj->id;
}
-git_otype git_object_type(git_object *obj)
+git_otype git_object_type(const git_object *obj)
{
assert(obj);
return obj->source.raw.type;
}
-git_repository *git_object_owner(git_object *obj)
+git_repository *git_object_owner(const git_object *obj)
{
assert(obj);
return obj->repo;