summaryrefslogtreecommitdiff
path: root/src/object.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2019-07-29 10:51:22 +0200
committerCarlos Martín Nieto <carlosmn@github.com>2019-07-29 11:15:32 +0200
commitc8e249b032f371b51d409052d571696798dbe862 (patch)
tree350239dfca247959c76e913efbe3103ffc1f3db5 /src/object.c
parente3adc99e1f9b71ceaddd650eba9c7c644290e4a6 (diff)
downloadlibgit2-cmn/object-size-nopublic.tar.gz
object: deprecate git_object__size for removalcmn/object-size-nopublic
In #5118 we remove the double-underscore to make it a normally-named public function. However, this is not an interesting function outside of the library and it takes up a name for something that could be more useful. Remove the single-underscore version as we have not done any releases with it.
Diffstat (limited to 'src/object.c')
-rw-r--r--src/object.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/src/object.c b/src/object.c
index c28629c48..8559de1c6 100644
--- a/src/object.c
+++ b/src/object.c
@@ -21,6 +21,7 @@
bool git_object__strict_input_validation = true;
extern int git_odb_hash(git_oid *out, const void *data, size_t len, git_object_t type);
+size_t git_object__size(git_object_t type);
typedef struct {
const char *str; /* type name string */
@@ -75,7 +76,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 +124,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 +317,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;
@@ -549,10 +550,3 @@ bool git_object__is_valid(
return true;
}
-
-/* Deprecated functions */
-
-size_t git_object__size(git_object_t type)
-{
- return git_object_size(type);
-}