Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Updates to reference and README
  • Loading branch information
Tim Branyen committed Feb 24, 2011
1 parent d65fc0b commit 85994b0
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
7 changes: 5 additions & 2 deletions README.md
Expand Up @@ -128,13 +128,16 @@ You will most likely install `nodeunit` and `rimraf` via `npm` or make an alias
Release information
-------------------

__ Can keep track of current method coverage at: [http://bit.ly/tb_methods](http://bit.ly/tb_methods)

### v0.0.1: ###
* 1:1 mapping of libgit2 read methods
* 1:1 mapping of core `libgit2` methods
* 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

### v0.0.2: ###
* Write capabilities
* More methods implemented
* Better test coverage
* GitHub landing page

### v0.0.3: ###
Expand Down
10 changes: 5 additions & 5 deletions src/reference.cc
Expand Up @@ -23,7 +23,7 @@ void Reference::Initialize(Handle<Object> target) {
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
constructor_template->SetClassName(String::NewSymbol("Ref"));

NODE_SET_PROTOTYPE_METHOD(constructor_template, "getOid", GetOid);
NODE_SET_PROTOTYPE_METHOD(constructor_template, "oid", Oid);

target->Set(String::NewSymbol("Ref"), constructor_template->GetFunction());
}
Expand All @@ -36,7 +36,7 @@ void Reference::SetValue(git_reference *ref) {
this->ref = ref;
}

const git_oid* Reference::GetOid() {
const git_oid* Reference::Oid() {
return git_reference_oid(this->ref);
}

Expand All @@ -49,7 +49,7 @@ Handle<Value> Reference::New(const Arguments& args) {
return args.This();
}

Handle<Value> Reference::GetOid(const Arguments& args) {
Handle<Value> Reference::Oid(const Arguments& args) {
Reference *ref = ObjectWrap::Unwrap<Reference>(args.This());
Local<Function> callback;

Expand All @@ -62,9 +62,9 @@ Handle<Value> Reference::GetOid(const Arguments& args) {
// callback = Local<Function>::Cast(args[2]);

//Oid *oid = ObjectWrap::Unwrap<Oid>(args[0]->ToObject());
//oid->SetValue((git_oid *)ref->GetOid());
//oid->SetValue((git_oid *)ref->Oid());
//
const git_oid* oid = ref->GetOid();
const git_oid* oid = ref->Oid();
Local<Object> obj;

Oid *t = new Oid();
Expand Down
4 changes: 2 additions & 2 deletions src/reference.h
Expand Up @@ -23,14 +23,14 @@ class Reference : public EventEmitter {
git_reference* GetValue();
// Synchronous
void SetValue(git_reference* ref);
const git_oid* GetOid();
const git_oid* Oid();

protected:
Reference() {}
~Reference() {}
static Handle<Value> New(const Arguments& args);

static Handle<Value> GetOid(const Arguments& args);
static Handle<Value> Oid(const Arguments& args);

private:
git_reference *ref;
Expand Down

0 comments on commit 85994b0

Please sign in to comment.