mirror of
https://git.proxmox.com/git/libgit2
synced 2026-01-15 22:47:34 +00:00
This adds create and free callback to the git_objects_table so that more of the creation and destruction of objects can be table driven instead of using switch statements. This also makes the semantics of certain object creation functions consistent so that we can make better use of function pointers. This also fixes a theoretical error case where an object allocation fails and we end up storing NULL into the cache.
25 lines
583 B
C
25 lines
583 B
C
/*
|
|
* Copyright (C) the libgit2 contributors. All rights reserved.
|
|
*
|
|
* This file is part of libgit2, distributed under the GNU GPL v2 with
|
|
* a Linking Exception. For full terms see the included COPYING file.
|
|
*/
|
|
#ifndef INCLUDE_blob_h__
|
|
#define INCLUDE_blob_h__
|
|
|
|
#include "git2/blob.h"
|
|
#include "repository.h"
|
|
#include "odb.h"
|
|
#include "fileops.h"
|
|
|
|
struct git_blob {
|
|
git_object object;
|
|
git_odb_object *odb_object;
|
|
};
|
|
|
|
void git_blob__free(void *blob);
|
|
int git_blob__from_odb_object(void *blob, git_odb_object *obj);
|
|
int git_blob__getbuf(git_buf *buffer, git_blob *blob);
|
|
|
|
#endif
|