]>
Commit | Line | Data |
---|---|---|
bb742ede VM |
1 | /* |
2 | * Copyright (C) 2009-2011 the libgit2 contributors | |
3 | * | |
4 | * This file is part of libgit2, distributed under the GNU GPL v2 with | |
5 | * a Linking Exception. For full terms see the included COPYING file. | |
6 | */ | |
3315782c VM |
7 | #ifndef INCLUDE_repository_h__ |
8 | #define INCLUDE_repository_h__ | |
9 | ||
44908fe7 VM |
10 | #include "git2/common.h" |
11 | #include "git2/oid.h" | |
12 | #include "git2/odb.h" | |
13 | #include "git2/repository.h" | |
f335b42c | 14 | #include "git2/object.h" |
3315782c VM |
15 | |
16 | #include "hashtable.h" | |
6fd195d7 | 17 | #include "index.h" |
72a3fe42 | 18 | #include "cache.h" |
9282e921 | 19 | #include "refs.h" |
afeecf4f | 20 | #include "buffer.h" |
ce8cd006 | 21 | #include "odb.h" |
df743c7d | 22 | #include "attr.h" |
3315782c | 23 | |
d2d6912e | 24 | #define DOT_GIT ".git" |
25 | #define GIT_DIR DOT_GIT "/" | |
ce8cd006 BR |
26 | #define GIT_DIR_MODE 0755 |
27 | #define GIT_BARE_DIR_MODE 0777 | |
d2d6912e | 28 | |
f49a2e49 | 29 | struct git_object { |
72a3fe42 | 30 | git_cached_obj cached; |
3315782c | 31 | git_repository *repo; |
72a3fe42 | 32 | git_otype type; |
3315782c VM |
33 | }; |
34 | ||
35 | struct git_repository { | |
9462c471 VM |
36 | git_odb *_odb; |
37 | git_config *_config; | |
38 | git_index *_index; | |
48c27f86 | 39 | |
72a3fe42 | 40 | git_cache objects; |
2f8a8ab2 | 41 | git_refcache references; |
ee1f0b1a | 42 | git_attr_cache attrcache; |
6fd195d7 VM |
43 | |
44 | char *path_repository; | |
9462c471 | 45 | char *workdir; |
6fd195d7 | 46 | |
6b2a1941 VM |
47 | unsigned is_bare:1; |
48 | unsigned int lru_counter; | |
3315782c VM |
49 | }; |
50 | ||
48c27f86 VM |
51 | /* fully free the object; internal method, do not |
52 | * export */ | |
72a3fe42 | 53 | void git_object__free(void *object); |
e802d8cc | 54 | |
06c43821 | 55 | int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end, const char *header); |
afeecf4f | 56 | void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid); |
58519018 | 57 | |
9462c471 VM |
58 | int git_repository_config__weakptr(git_config **out, git_repository *repo); |
59 | int git_repository_odb__weakptr(git_odb **out, git_repository *repo); | |
60 | int git_repository_index__weakptr(git_index **out, git_repository *repo); | |
61 | ||
3315782c | 62 | #endif |