repository.h 999 Bytes
Newer Older
1 2 3
#ifndef INCLUDE_repository_h__
#define INCLUDE_repository_h__

4 5 6 7
#include "git2/common.h"
#include "git2/oid.h"
#include "git2/odb.h"
#include "git2/repository.h"
8
#include "git2/object.h"
9 10

#include "hashtable.h"
11
#include "index.h"
Vicent Marti committed
12
#include "cache.h"
13
#include "refs.h"
14

15 16 17 18 19
#define DOT_GIT ".git"
#define GIT_DIR DOT_GIT "/"
#define GIT_OBJECTS_DIR "objects/"
#define GIT_INDEX_FILE "index"

20
struct git_object {
Vicent Marti committed
21
	git_cached_obj cached;
22
	git_repository *repo;
Vicent Marti committed
23
	git_otype type;
24 25 26 27
};

struct git_repository {
	git_odb *db;
28
	git_index *index;
29

Vicent Marti committed
30
	git_cache objects;
31
	git_refcache references;
32 33 34 35 36 37

	char *path_repository;
	char *path_index;
	char *path_odb;
	char *path_workdir;

38 39
	unsigned is_bare:1;
	unsigned int lru_counter;
40 41
};

42 43
/* fully free the object; internal method, do not
 * export */
Vicent Marti committed
44
void git_object__free(void *object);
45

46
int git__parse_oid(git_oid *oid, char **buffer_out, const char *buffer_end, const char *header);
Vicent Marti committed
47
int git__write_oid(git_odb_stream *src, const char *header, const git_oid *oid);
48

49
#endif