aboutsummaryrefslogtreecommitdiff
path: root/odb/source-files.c
diff options
context:
space:
mode:
Diffstat (limited to 'odb/source-files.c')
-rw-r--r--odb/source-files.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/odb/source-files.c b/odb/source-files.c
new file mode 100644
index 0000000000..cbdaa6850f
--- /dev/null
+++ b/odb/source-files.c
@@ -0,0 +1,23 @@
+#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;
+}