Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix functions that return string in Commit class

  • Loading branch information...
commit daa680e6a273910d0196c8a54eb3124fa1f384ce 1 parent cb6b10e
@sa1 sa1 authored
Showing with 12 additions and 3 deletions.
  1. +4 −3 src/Git2/Commit.winxed
  2. +8 −0 t/winxed/001_load.t
View
7 src/Git2/Commit.winxed
@@ -32,10 +32,10 @@ namespace Git2 {
int ctime = git_commit_time(self.ptr);
return ctime;
}
- // TODO convert to Parrot strings
function message(){
using Git2.Raw.git_commit_message;
- var message = git_commit_message(self.ptr);
+ var cmessage = git_commit_message(self.ptr);
+ string message = atos(cmessage);
return message;
}
/*
@@ -86,7 +86,8 @@ namespace Git2 {
*/
function encoding(){
using Git2.Raw.git_commit_message_encoding;
- var encoding = git_commit_message_encoding(self.ptr);
+ var cencoding = git_commit_message_encoding(self.ptr);
+ string encoding = atos(cencoding);
return encoding;
}
function free(){
View
8 t/winxed/001_load.t
@@ -130,10 +130,15 @@ class Test_git2_repository_open {
using Git2.Repository;
var repo = new Git2.Repository();
+ print("Cloning repository...\n");
repo.clone("https://github.com/letolabs/parrot-libgit2.git", "/tmp/parrot");
var ptr = repo.get_pointer();
self.assert.defined(ptr, "Repository not cloned.");
+ string cmd = "rm -rf /tmp/parrot";
+ int result;
+ ${spawnw result, cmd};
+
}
function show_branch(){
@@ -189,6 +194,9 @@ class Test_git2_repository_open {
int offset = commit1.commit_time_offset();
self.assert.not_null(offset);
+ string message1 = commit1.message();
+ self.assert.equal(message1, "NCI updates for libgit2 0.19\n");
+
int parentcount = commit1.parentcount();
self.assert.not_null(parentcount);
Please sign in to comment.
Something went wrong with that request. Please try again.