Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2013-04-20 03:19:53 +0400
committerEdward Thomson <ethomson@microsoft.com>2013-04-20 03:43:17 +0400
commit4e4eab52f7c5062ea21ea278a38e48700e753883 (patch)
tree4c8133d7595b355e3150b4525e25ad25103d10ff /src/refdb.c
parent4a38143c93dc705bc40109e3f79d7fac722d44d7 (diff)
alloc doesn't take a refdb; git_refdb_free nicely in the tests
Diffstat (limited to 'src/refdb.c')
-rw-r--r--src/refdb.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/refdb.c b/src/refdb.c
index d9b73c6e7..2a0fd702c 100644
--- a/src/refdb.c
+++ b/src/refdb.c
@@ -45,7 +45,7 @@ int git_refdb_open(git_refdb **out, git_repository *repo)
return -1;
/* Add the default (filesystem) backend */
- if (git_refdb_backend_fs(&dir, repo, db) < 0) {
+ if (git_refdb_backend_fs(&dir, repo) < 0) {
git_refdb_free(db);
return -1;
}
@@ -111,9 +111,20 @@ int git_refdb_exists(int *exists, git_refdb *refdb, const char *ref_name)
int git_refdb_lookup(git_reference **out, git_refdb *db, const char *ref_name)
{
+ git_reference *ref;
+ int error;
+
assert(db && db->backend && ref_name);
- return db->backend->lookup(out, db->backend, ref_name);
+ *out = NULL;
+
+ if ((error = db->backend->lookup(&ref, db->backend, ref_name)) == 0)
+ {
+ ref->db = db;
+ *out = ref;
+ }
+
+ return error;
}
int git_refdb_foreach(