Commit 3435313c authored by tim's avatar tim

Updated revwalk

parent c97f2258
......@@ -111,7 +111,7 @@ Release information
__ Can keep track of current method coverage at: [http://bit.ly/tb_methods](http://bit.ly/tb_methods) __
### v0.1: ###
### v0.0.1: ###
* Some useful methods implemented
* Some unit tests
* Some documented source code
......@@ -120,14 +120,15 @@ __ Can keep track of current method coverage at: [http://bit.ly/tb_methods](http
* An API that can be easily extended with convenience methods in JS
* An API that offers a familiar clean syntax that will make adoption and use much more likely
* Open for public testing
* Be able to open and read a repo and fetch all its commits and lookup specific commits and their associated metadata + reading blob rawcontent.
### v0.2: ###
### v0.0.2: ###
* More methods implemented
* More unit tests
* GitHub landing page
* More API development
### v0.3: ###
### v0.0.3: ###
* Custom odb backend
* API coverage in GitHub Wiki
......
......@@ -10,16 +10,20 @@ repo.open('./.git', function(err, path) {
master = new git2.Ref(repo),
commit = new git2.Commit(repo);
oid.mkstr('5f2aa9407f7b3aeb531c621c3358953841ccfc98')
//oid.mkstr('5f2aa9407f7b3aeb531c621c3358953841ccfc98')
commit.lookup( repo, oid, function( err ) {
console.log( 'Error: '+ error.strError(err) );
});
//commit.lookup( repo, oid, function( err ) {
// console.log( 'Error: '+ error.strError(err) );
//});
//repo.lookupRef( master, "refs/heads/master", function( err, ref ) {
// console.log(master.toString(40));
// if( err ) { console.log(error.strError(err)); return; }
// console.log( error.strError( revwalk.push( master.oid() ) ) );
//});
repo.lookupRef( master, "refs/heads/master", function( err, ref ) {
if( err ) { console.log(error.strError(err)); return; }
var newOid = new git2.Oid();
console.log(newOid.toString(40));
commit.lookup( repo, newOid, function( err ) {
console.log('Test', this);
console.log( error.strError( revwalk.push( this ) ) );
});
});
});
{
"name": "nodegit2",
"description": "NodeJS libgit2 asynchronous native bindings",
"version": "0.1",
"version": "0.0.1",
"homepage": "https://github.com/tbranyen/nodegit2",
"author": "Tim Branyen <tim@tabdeveloper.com> (http://twitter.com/tbranyen)",
"main": "./lib/index.js",
......@@ -9,6 +9,10 @@
"type": "git",
"url": "git://github.com/tbranyen/nodegit2.git"
},
"directories": {
"build": "./build",
"lib": "./lib"
},
"modules": {
"index": "./lib/index"
},
......
......@@ -64,26 +64,17 @@ Handle<Value> Reference::New(const Arguments& args) {
Handle<Value> Reference::Oid(const Arguments& args) {
Reference *ref = ObjectWrap::Unwrap<Reference>(args.This());
Local<Function> callback;
HandleScope scope;
// if(args.Length() == 0 || !args[0]->IsObject()) {
// return ThrowException(Exception::Error(String::New("Oid is required and must be an Object.")));
// }
//
// callback = Local<Function>::Cast(args[2]);
//Oid *oid = ObjectWrap::Unwrap<Oid>(args[0]->ToObject());
//oid->SetValue((git_oid *)ref->Oid());
//
const git_oid* oid = ref->Oid();
Local<Object> obj;
//Oid *t = new Oid();
//t->SetValue((git_oid *)oid);
//return t->WrapObj(obj);
return callback;
if(args.Length() == 0 || !args[0]->IsObject()) {
return ThrowException(Exception::Error(String::New("Oid is required and must be an Object.")));
}
Oid *oid = ObjectWrap::Unwrap<Oid>(args[0]->ToObject());
oid->SetValue( (git_oid *)ref->Oid() );
return Undefined();
}
Persistent<FunctionTemplate> Reference::constructor_template;
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment