mirror of
https://github.com/git/git.git
synced 2026-03-09 08:42:35 +01:00
Introduce a new "files" object database source. This source encapsulates access to both loose object files and the packfile store, similar to how the "files" backend for refs encapsulates access to loose refs and the packed-refs file. Note that for now the "files" source is still a direct member of a `struct odb_source`. This architecture will be reversed in the next commit so that the files source contains a `struct odb_source`. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
27 lines
532 B
C
27 lines
532 B
C
#include "git-compat-util.h"
|
|
#include "object-file.h"
|
|
#include "odb/source.h"
|
|
#include "packfile.h"
|
|
|
|
struct odb_source *odb_source_new(struct object_database *odb,
|
|
const char *path,
|
|
bool local)
|
|
{
|
|
struct odb_source *source;
|
|
|
|
CALLOC_ARRAY(source, 1);
|
|
source->odb = odb;
|
|
source->local = local;
|
|
source->path = xstrdup(path);
|
|
source->files = odb_source_files_new(source);
|
|
|
|
return source;
|
|
}
|
|
|
|
void odb_source_free(struct odb_source *source)
|
|
{
|
|
free(source->path);
|
|
odb_source_files_free(source->files);
|
|
free(source);
|
|
}
|