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:
authorHan-Wen Nienhuys <hanwen@google.com>2012-05-12 22:01:39 +0400
committerHan-Wen Nienhuys <hanwen@xs4all.nl>2012-05-12 22:50:19 +0400
commit24634c6fd02b2240e4a93fad70a08220f8fb793a (patch)
tree74188351355bc3c8818957d8343d5c3308dcf18a /tests-clar/odb
parentb72969e0643cb561b42aceec4d1a18ce9c782c09 (diff)
Handle duplicate objects from different backends in git_odb_read_prefix().
Diffstat (limited to 'tests-clar/odb')
-rw-r--r--tests-clar/odb/mixed.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/tests-clar/odb/mixed.c b/tests-clar/odb/mixed.c
new file mode 100644
index 000000000..7c28a434e
--- /dev/null
+++ b/tests-clar/odb/mixed.c
@@ -0,0 +1,25 @@
+#include "clar_libgit2.h"
+#include "odb.h"
+#include "pack_data.h"
+
+static git_odb *_odb;
+
+void test_odb_mixed__initialize(void)
+{
+ cl_git_pass(git_odb_open(&_odb, cl_fixture("duplicate.git/objects")));
+}
+
+void test_odb_mixed__cleanup(void)
+{
+ git_odb_free(_odb);
+}
+
+void test_odb_mixed__dup_oid(void) {
+ const char hex[] = "ce013625030ba8dba906f756967f9e9ca394464a";
+ git_oid oid;
+ git_odb_object *obj;
+ cl_git_pass(git_oid_fromstr(&oid, hex));
+ cl_git_pass(git_odb_read_prefix(&obj, _odb, &oid, GIT_OID_HEXSZ));
+ git_odb_object_free(obj);
+}
+