summaryrefslogtreecommitdiff
path: root/src/refs.h
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2013-03-01 15:37:33 -0600
committerEdward Thomson <ethomson@edwardthomson.com>2013-03-07 11:01:52 -0600
commitd00d54645d931c77a9b401518c0d73e3f640454b (patch)
treee1932dcc97172a53524e9db1ba4923cf137a4f9c /src/refs.h
parent6a9ef012376e8a21dcfd0499ab16048eb6e954c3 (diff)
downloadlibgit2-d00d54645d931c77a9b401518c0d73e3f640454b.tar.gz
immutable references and a pluggable ref database
Diffstat (limited to 'src/refs.h')
-rw-r--r--src/refs.h19
1 files changed, 7 insertions, 12 deletions
diff --git a/src/refs.h b/src/refs.h
index 7bd1ae68a..7d63c3fbd 100644
--- a/src/refs.h
+++ b/src/refs.h
@@ -10,6 +10,7 @@
#include "common.h"
#include "git2/oid.h"
#include "git2/refs.h"
+#include "git2/refdb.h"
#include "strmap.h"
#include "buffer.h"
@@ -47,28 +48,22 @@
#define GIT_REFNAME_MAX 1024
struct git_reference {
- unsigned int flags;
- git_repository *owner;
- char *name;
- time_t mtime;
+ git_refdb *db;
+
+ git_ref_t type;
union {
git_oid oid;
char *symbolic;
} target;
+
+ char name[0];
};
-typedef struct {
- git_strmap *packfile;
- time_t packfile_time;
-} git_refcache;
-
-void git_repository__refcache_free(git_refcache *refs);
-
int git_reference__normalize_name_lax(char *buffer_out, size_t out_size, const char *name);
int git_reference__normalize_name(git_buf *buf, const char *name, unsigned int flags);
+int git_reference__update_terminal(git_repository *repo, const char *ref_name, const git_oid *oid);
int git_reference__is_valid_name(const char *refname, unsigned int flags);
-int git_reference__update(git_repository *repo, const git_oid *oid, const char *ref_name);
int git_reference__is_branch(const char *ref_name);
int git_reference__is_remote(const char *ref_name);