]> git.proxmox.com Git - libgit2.git/blob - src/refs.h
Cleanup legal data
[libgit2.git] / src / refs.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_refs_h__
8 #define INCLUDE_refs_h__
9
10 #include "common.h"
11 #include "git2/oid.h"
12 #include "git2/refs.h"
13 #include "hashtable.h"
14
15 #define GIT_REFS_DIR "refs/"
16 #define GIT_REFS_HEADS_DIR GIT_REFS_DIR "heads/"
17 #define GIT_REFS_TAGS_DIR GIT_REFS_DIR "tags/"
18 #define GIT_REFS_REMOTES_DIR GIT_REFS_DIR "remotes/"
19
20 #define GIT_RENAMED_REF_FILE GIT_REFS_DIR "RENAMED-REF"
21
22 #define GIT_SYMREF "ref: "
23 #define GIT_PACKEDREFS_FILE "packed-refs"
24 #define GIT_PACKEDREFS_HEADER "# pack-refs with: peeled "
25
26 #define GIT_HEAD_FILE "HEAD"
27 #define GIT_MERGE_HEAD_FILE "MERGE_HEAD"
28 #define GIT_REFS_HEADS_MASTER_FILE GIT_REFS_HEADS_DIR "master"
29
30 #define GIT_REFNAME_MAX 1024
31
32 struct git_reference {
33 git_repository *owner;
34 char *name;
35 unsigned int type;
36 time_t mtime;
37 };
38
39 typedef struct {
40 git_hashtable *packfile;
41 git_hashtable *loose_cache;
42 time_t packfile_time;
43 } git_refcache;
44
45
46 void git_repository__refcache_free(git_refcache *refs);
47 int git_repository__refcache_init(git_refcache *refs);
48
49 int git_reference__normalize_name(char *buffer_out, size_t out_size, const char *name);
50 int git_reference__normalize_name_oid(char *buffer_out, size_t out_size, const char *name);
51
52 #endif