Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Add commit parsing API

  • Loading branch information...
commit 49b51b71e72e7a747396ff14aed19ea3f0d2faee 1 parent eb3ed3d
@sa1 sa1 authored
Showing with 49 additions and 0 deletions.
  1. +49 −0 src/Git2/Commit.winxed
View
49 src/Git2/Commit.winxed
@@ -0,0 +1,49 @@
+$include_const 'datatypes.pasm';
+$include_const "iglobals.pasm";
+
+namespace Git2 {
+ class Commit {
+ var ptr;
+ function Commit() {
+ }
+ function commit_lookup(repo, oid){
+ using Git2.Git.commit_lookup;
+
+ self.ptr = commit_lookup(repo.ptr, oid.ptr);
+ }
+ function commit_time(){
+ using Git2.Raw.git_commit_time;
+ 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);
+ return message;
+ }
+ function author(){
+ using Git2.Raw.git_commit_author;
+ var author = git_commit_author(self.ptr);
+ return author;
+ }
+ function commiter(){
+ using Git2.Raw.git_commit_committer;
+ var commiter = git_commit_committer(self.ptr);
+ return commiter;
+ }
+ function parentcount(){
+ using Git2.Raw.git_commit_parentcount;
+ int parentcount = git_commit_parentcount(self.ptr);
+ return parentcount;
+ }
+ function parent(p){
+ using Git2.Raw.git_commit_parent;
+ using Git2.Git2.parent;
+ var parent_commit = new Git2.Commit();
+ var parent_ptr = parent(self.ptr, p);
+ parent_commit.ptr = parent_ptr;
+ return parent_commit;
+ }
+ }
+}
Please sign in to comment.
Something went wrong with that request. Please try again.