summaryrefslogtreecommitdiff
path: root/src/repository.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/repository.h')
-rw-r--r--src/repository.h10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/repository.h b/src/repository.h
index 2e8d187b0..4af062e97 100644
--- a/src/repository.h
+++ b/src/repository.h
@@ -15,8 +15,6 @@
#define GIT_OBJECTS_DIR "objects/"
#define GIT_INDEX_FILE "index"
-#define GIT_OBJECT_INCREF(ob) ++(((git_object *)(ob))->refcount)
-
typedef struct {
git_rawobj raw;
void *write_ptr;
@@ -62,4 +60,12 @@ int git__source_write(git_odb_source *source, const void *bytes, size_t len);
int git__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_end, const char *header);
int git__write_oid(git_odb_source *src, const char *header, const git_oid *oid);
+#define GIT_OBJECT_INCREF(ob) git_object__incref((git_object *)(ob))
+
+GIT_INLINE(void) git_object__incref(struct git_object *object)
+{
+ if (object)
+ object->refcount++;
+}
+
#endif