File tree Expand file tree Collapse file tree 4 files changed +34
-0
lines changed
Expand file tree Collapse file tree 4 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -9,3 +9,5 @@ src/Git2/Common.pir
99src /Git2 /RefCache.pir
1010src /Git2 /Repository.pir
1111src /Git2 /Index.pir
12+ src /Git2 /Oid.pir
13+ src /Git2 /Odb.pir
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ function setup_stable_libraries(var parrot_libgit2) {
4343 'Cache',
4444 'Common',
4545 'Index',
46+ 'Odb',
4647 'RefCache',
4748 'Repository'
4849 ];
Original file line number Diff line number Diff line change 1+ $include_const 'datatypes.pasm';
2+ $include_const "iglobals.pasm";
3+
4+ namespace Git2 {
5+ class Odb {
6+ function get_sv() {
7+ /*
8+ typedef struct {
9+ } git_odb
10+ */
11+
12+ var sv = new 'StructView'([ DATATYPE_STRUCT, 1,
13+ DATATYPE_PTR
14+ ]);
15+
16+ while (1) { yield(sv); }
17+ }
18+ var ptr;
19+ function Odb() {
20+ self.ptr = self.get_sv().alloc();
21+ }
22+ }
23+ }
Original file line number Diff line number Diff line change @@ -4,6 +4,9 @@ $load "rosella/test.pbc";
44$ load " ./src/git2.pbc" ;
55$ load " ./src/Git2/Common.pbc" ;
66$ load " ./src/Git2/Repository.pbc" ;
7+ $ load " ./src/Git2/Odb.pbc" ;
8+ $ load " ./src/Git2/Cache.pbc" ;
9+ $ load " ./src/Git2/RefCache.pbc" ;
710$ load " dumper.pbc" ;
811
912$ include_const ' datatypes.pasm' ;
@@ -55,6 +58,7 @@ class Test_git2_repository_open {
5558 using Git2. Raw. git_repository_free;
5659 using Git2. Raw. git_index_open_inrepo;
5760 using Git2. Raw. git_repository_is_bare;
61+ using Git2. Raw. git_repository_database;
5862 using cstring;
5963
6064 var repo = new Git2. Repository();
@@ -77,6 +81,10 @@ class Test_git2_repository_open {
7781 var bool = git_repository_is_bare(repo. ptr);
7882 self . assert. equal(bool ,0 );
7983
84+ var odb = git_repository_database(repo. ptr);
85+ self . assert. defined (odb);
86+
87+ // coredumps inside libgit2
8088 // git_repository_free(repo. ptr);
8189 }
8290
You can’t perform that action at this time.
0 commit comments