summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2019-06-16 00:23:01 +0100
committerEdward Thomson <ethomson@edwardthomson.com>2019-06-16 00:23:01 +0100
commitb7791d0426884088743a8dafac1001de21650285 (patch)
treec0a1fdf2b2d97a046c412fe29421e35a7e8d7e84
parentfef847ae57d74e93563bc04222d9da7007fffc4f (diff)
downloadlibgit2-ethomson/object_size.tar.gz
object: rename git_object__size to git_object_sizeethomson/object_size
We don't use double-underscores in the public API.
-rw-r--r--include/git2/deprecated.h2
-rw-r--r--include/git2/object.h2
-rw-r--r--src/object.c12
3 files changed, 12 insertions, 4 deletions
diff --git a/include/git2/deprecated.h b/include/git2/deprecated.h
index 09388cbb4..0195917bb 100644
--- a/include/git2/deprecated.h
+++ b/include/git2/deprecated.h
@@ -235,6 +235,8 @@ GIT_EXTERN(void) giterr_set_oom(void);
#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
+GIT_EXTERN(size_t) git_object__size(git_object_t type);
+
/**@}*/
/** @name Deprecated Reference Constants
diff --git a/include/git2/object.h b/include/git2/object.h
index 01dc37ace..9b4517830 100644
--- a/include/git2/object.h
+++ b/include/git2/object.h
@@ -197,7 +197,7 @@ GIT_EXTERN(int) git_object_typeisloose(git_object_t type);
* @param type object type to get its size
* @return size in bytes of the object
*/
-GIT_EXTERN(size_t) git_object__size(git_object_t type);
+GIT_EXTERN(size_t) git_object_size(git_object_t type);
/**
* Recursively peel an object until an object of the specified type is met.
diff --git a/src/object.c b/src/object.c
index 15f2722c7..17b9794c9 100644
--- a/src/object.c
+++ b/src/object.c
@@ -75,7 +75,7 @@ int git_object__from_raw(
return GIT_ENOTFOUND;
}
- if ((object_size = git_object__size(type)) == 0) {
+ if ((object_size = git_object_size(type)) == 0) {
git_error_set(GIT_ERROR_INVALID, "the requested type is invalid");
return GIT_ENOTFOUND;
}
@@ -123,7 +123,7 @@ int git_object__from_odb_object(
return GIT_ENOTFOUND;
}
- if ((object_size = git_object__size(odb_obj->cached.type)) == 0) {
+ if ((object_size = git_object_size(odb_obj->cached.type)) == 0) {
git_error_set(GIT_ERROR_INVALID, "the requested type is invalid");
return GIT_ENOTFOUND;
}
@@ -316,7 +316,7 @@ int git_object_typeisloose(git_object_t type)
return (git_objects_table[type].size > 0) ? 1 : 0;
}
-size_t git_object__size(git_object_t type)
+size_t git_object_size(git_object_t type)
{
if (type < 0 || ((size_t) type) >= ARRAY_SIZE(git_objects_table))
return 0;
@@ -550,3 +550,9 @@ bool git_object__is_valid(
return true;
}
+/* Deprecated functions */
+
+size_t git_object__size(git_object_t type)
+{
+ return git_object_size(type);
+}