mirror of
https://github.com/git-for-windows/git.git
synced 2026-05-04 19:16:21 -05: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>
24 lines
549 B
C
24 lines
549 B
C
#include "git-compat-util.h"
|
|
#include "object-file.h"
|
|
#include "odb/source-files.h"
|
|
#include "packfile.h"
|
|
|
|
void odb_source_files_free(struct odb_source_files *files)
|
|
{
|
|
if (!files)
|
|
return;
|
|
odb_source_loose_free(files->loose);
|
|
packfile_store_free(files->packed);
|
|
free(files);
|
|
}
|
|
|
|
struct odb_source_files *odb_source_files_new(struct odb_source *source)
|
|
{
|
|
struct odb_source_files *files;
|
|
CALLOC_ARRAY(files, 1);
|
|
files->source = source;
|
|
files->loose = odb_source_loose_new(source);
|
|
files->packed = packfile_store_new(source);
|
|
return files;
|
|
}
|