Mark git_oid parameters const when they shouldn't be modified Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
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
diff --git a/src/git_odb.c b/src/git_odb.c
index f1b1698..f2ee83a 100644
--- a/src/git_odb.c
+++ b/src/git_odb.c
@@ -35,7 +35,7 @@
#include "git_odb.h"
-git_result git_odb_sread(git_sobj *out, git_odb *db, git_oid *id)
+git_result git_odb_sread(git_sobj *out, git_odb *db, const git_oid *id)
{
if (!git_odb__sread_packed(out, db, id))
return GIT_SUCCESS;
diff --git a/src/git_odb.h b/src/git_odb.h
index c72d81b..c994bb4 100644
--- a/src/git_odb.h
+++ b/src/git_odb.h
@@ -106,7 +106,7 @@ typedef struct {
* @return GIT_SUCCESS if the object was read;
* GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(git_result) git_odb_sread(git_sobj *out, git_odb *db, git_oid *id);
+GIT_EXTERN(git_result) git_odb_sread(git_sobj *out, git_odb *db, const git_oid *id);
/**
* Read a small object from the database using only pack files.
@@ -116,7 +116,7 @@ GIT_EXTERN(git_result) git_odb_sread(git_sobj *out, git_odb *db, git_oid *id);
* @return GIT_SUCCESS if the object was read;
* GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(git_result) git_odb__sread_packed(git_sobj *out, git_odb *db, git_oid *id);
+GIT_EXTERN(git_result) git_odb__sread_packed(git_sobj *out, git_odb *db, const git_oid *id);
/**
* Read a small object from the database using only loose object files.
@@ -126,7 +126,7 @@ GIT_EXTERN(git_result) git_odb__sread_packed(git_sobj *out, git_odb *db, git_oid
* @return GIT_SUCCESS if the object was read;
* GIT_ENOTFOUND if the object is not in the database.
*/
-GIT_EXTERN(git_result) git_odb__sread_loose(git_sobj *out, git_odb *db, git_oid *id);
+GIT_EXTERN(git_result) git_odb__sread_loose(git_sobj *out, git_odb *db, const git_oid *id);
/** @} */
GIT_END_DECL