]> git.proxmox.com Git - libgit2.git/blob - src/repository.h
*: correct and codify various file permissions
[libgit2.git] / src / repository.h
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 */
7 #ifndef INCLUDE_repository_h__
8 #define INCLUDE_repository_h__
9
10 #include "git2/common.h"
11 #include "git2/oid.h"
12 #include "git2/odb.h"
13 #include "git2/repository.h"
14 #include "git2/object.h"
15
16 #include "hashtable.h"
17 #include "index.h"
18 #include "cache.h"
19 #include "refs.h"
20 #include "buffer.h"
21 #include "odb.h"
22
23 #define DOT_GIT ".git"
24 #define GIT_DIR DOT_GIT "/"
25 #define GIT_DIR_MODE 0755
26 #define GIT_BARE_DIR_MODE 0777
27
28 struct git_object {
29 git_cached_obj cached;
30 git_repository *repo;
31 git_otype type;
32 };
33
34 struct git_repository {
35 git_odb *db;
36
37 git_cache objects;
38 git_refcache references;
39
40 char *path_repository;
41 char *path_index;
42 char *path_odb;
43 char *path_workdir;
44
45 unsigned is_bare:1;
46 unsigned int lru_counter;
47 };
48
49 /* fully free the object; internal method, do not
50 * export */
51 void git_object__free(void *object);
52
53 int git_oid__parse(git_oid *oid, const char **buffer_out, const char *buffer_end, const char *header);
54 void git_oid__writebuf(git_buf *buf, const char *header, const git_oid *oid);
55
56 #endif