summaryrefslogtreecommitdiff
path: root/src/refdb_fs.c
diff options
context:
space:
mode:
authorVicent Marti <tanoku@gmail.com>2013-04-17 17:33:51 +0200
committerVicent Marti <tanoku@gmail.com>2013-04-17 17:33:51 +0200
commit3be933b143731bbe3a5cadcdf70b8ab205a629c0 (patch)
tree9688ce16cb1fa2ee16499d20e5d501a2f3d98d90 /src/refdb_fs.c
parentf124ebd457bfbf43de3516629aaba5a279636e04 (diff)
downloadlibgit2-3be933b143731bbe3a5cadcdf70b8ab205a629c0.tar.gz
refs: Add `git_referene_target_peel`
Diffstat (limited to 'src/refdb_fs.c')
-rw-r--r--src/refdb_fs.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/refdb_fs.c b/src/refdb_fs.c
index f00bd72a0..730148a8f 100644
--- a/src/refdb_fs.c
+++ b/src/refdb_fs.c
@@ -430,7 +430,7 @@ static int loose_lookup(
goto done;
}
- *out = git_reference__alloc(backend->refdb, ref_name, NULL, target);
+ *out = git_reference__alloc_symbolic(backend->refdb, ref_name, target);
} else {
if ((error = loose_parse_oid(&oid, &ref_file)) < 0)
goto done;
@@ -484,7 +484,8 @@ static int packed_lookup(
if ((error = packed_map_entry(&entry, &pos, backend, ref_name)) < 0)
return error;
- if ((*out = git_reference__alloc(backend->refdb, ref_name, &entry->oid, NULL)) == NULL)
+ if ((*out = git_reference__alloc(backend->refdb, ref_name,
+ &entry->oid, &entry->peel)) == NULL)
return -1;
return 0;
@@ -644,7 +645,7 @@ static int loose_write(refdb_fs_backend *backend, const git_reference *ref)
if (ref->type == GIT_REF_OID) {
char oid[GIT_OID_HEXSZ + 1];
- git_oid_fmt(oid, &ref->target.oid);
+ git_oid_fmt(oid, &ref->target.direct.oid);
oid[GIT_OID_HEXSZ] = '\0';
git_filebuf_printf(&file, "%s\n", oid);