Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit daa680e

Browse files
committed
Fix functions that return string in Commit class
1 parent cb6b10e commit daa680e

2 files changed

Lines changed: 12 additions & 3 deletions

File tree

src/Git2/Commit.winxed

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,10 +32,10 @@ namespace Git2 {
3232
int ctime = git_commit_time(self.ptr);
3333
return ctime;
3434
}
35-
// TODO convert to Parrot strings
3635
function message(){
3736
using Git2.Raw.git_commit_message;
38-
var message = git_commit_message(self.ptr);
37+
var cmessage = git_commit_message(self.ptr);
38+
string message = atos(cmessage);
3939
return message;
4040
}
4141
/*
@@ -86,7 +86,8 @@ namespace Git2 {
8686
*/
8787
function encoding(){
8888
using Git2.Raw.git_commit_message_encoding;
89-
var encoding = git_commit_message_encoding(self.ptr);
89+
var cencoding = git_commit_message_encoding(self.ptr);
90+
string encoding = atos(cencoding);
9091
return encoding;
9192
}
9293
function free(){

t/winxed/001_load.t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,10 +130,15 @@ class Test_git2_repository_open {
130130
using Git2.Repository;
131131

132132
var repo = new Git2.Repository();
133+
print("Cloning repository...\n");
133134
repo.clone("https://github.com/letolabs/parrot-libgit2.git", "/tmp/parrot");
134135
var ptr = repo.get_pointer();
135136
self.assert.defined(ptr, "Repository not cloned.");
136137

138+
string cmd = "rm -rf /tmp/parrot";
139+
int result;
140+
${spawnw result, cmd};
141+
137142
}
138143

139144
function show_branch(){
@@ -189,6 +194,9 @@ class Test_git2_repository_open {
189194
int offset = commit1.commit_time_offset();
190195
self.assert.not_null(offset);
191196

197+
string message1 = commit1.message();
198+
self.assert.equal(message1, "NCI updates for libgit2 0.19\n");
199+
192200
int parentcount = commit1.parentcount();
193201
self.assert.not_null(parentcount);
194202

0 commit comments

Comments
 (0)