Skip to content

Commit 2bdb617

Browse files
authored
Merge pull request libgit2#5118 from libgit2/ethomson/object_size
object: rename git_object__size to git_object_size
2 parents fef847a + b7791d0 commit 2bdb617

File tree

3 files changed

+12
-4
lines changed

3 files changed

+12
-4
lines changed

include/git2/deprecated.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,8 @@ GIT_EXTERN(void) giterr_set_oom(void);
235235
#define GIT_OBJ_OFS_DELTA GIT_OBJECT_OFS_DELTA
236236
#define GIT_OBJ_REF_DELTA GIT_OBJECT_REF_DELTA
237237

238+
GIT_EXTERN(size_t) git_object__size(git_object_t type);
239+
238240
/**@}*/
239241

240242
/** @name Deprecated Reference Constants

include/git2/object.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -197,7 +197,7 @@ GIT_EXTERN(int) git_object_typeisloose(git_object_t type);
197197
* @param type object type to get its size
198198
* @return size in bytes of the object
199199
*/
200-
GIT_EXTERN(size_t) git_object__size(git_object_t type);
200+
GIT_EXTERN(size_t) git_object_size(git_object_t type);
201201

202202
/**
203203
* Recursively peel an object until an object of the specified type is met.

src/object.c

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ int git_object__from_raw(
7575
return GIT_ENOTFOUND;
7676
}
7777

78-
if ((object_size = git_object__size(type)) == 0) {
78+
if ((object_size = git_object_size(type)) == 0) {
7979
git_error_set(GIT_ERROR_INVALID, "the requested type is invalid");
8080
return GIT_ENOTFOUND;
8181
}
@@ -123,7 +123,7 @@ int git_object__from_odb_object(
123123
return GIT_ENOTFOUND;
124124
}
125125

126-
if ((object_size = git_object__size(odb_obj->cached.type)) == 0) {
126+
if ((object_size = git_object_size(odb_obj->cached.type)) == 0) {
127127
git_error_set(GIT_ERROR_INVALID, "the requested type is invalid");
128128
return GIT_ENOTFOUND;
129129
}
@@ -316,7 +316,7 @@ int git_object_typeisloose(git_object_t type)
316316
return (git_objects_table[type].size > 0) ? 1 : 0;
317317
}
318318

319-
size_t git_object__size(git_object_t type)
319+
size_t git_object_size(git_object_t type)
320320
{
321321
if (type < 0 || ((size_t) type) >= ARRAY_SIZE(git_objects_table))
322322
return 0;
@@ -550,3 +550,9 @@ bool git_object__is_valid(
550550
return true;
551551
}
552552

553+
/* Deprecated functions */
554+
555+
size_t git_object__size(git_object_t type)
556+
{
557+
return git_object_size(type);
558+
}

0 commit comments

Comments
 (0)