Skip to content

Commit 18ab92e

Browse files
committed
Renamed ref to reference
1 parent cbcf619 commit 18ab92e

3 files changed

Lines changed: 15 additions & 12 deletions

File tree

include/reference.h

100755100644
Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
1-
/*
2-
Copyright (c) 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
3-
*/
1+
/**
2+
* Copyright (c) 2011, Tim Branyen @tbranyen <tim@tabdeveloper.com>
3+
* @author Michael Robinson @codeofinterest <mike@pagesofinterest.net>
4+
*
5+
* Dual licensed under the MIT and GPL licenses.
6+
*/
47

58
#ifndef REF_H
69
#define REF_H
@@ -19,7 +22,7 @@ using namespace v8;
1922

2023
class GitReference : public ObjectWrap {
2124
public:
22-
static Persistent<FunctionTemplate> constructor_template;
25+
static Persistent<Function> constructor_template;
2326
static void Initialize(Handle<v8::Object> target);
2427
git_reference* GetValue();
2528
void SetValue(git_reference* ref);

lib/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ exports.repo = require("./repo.js").repo;
1515
exports.sig = require("./sig.js").sig;
1616
exports.oid = require("./oid.js").oid;
1717
exports.object = require("./object.js").object;
18-
exports.ref = require("./reference.js").ref;
18+
exports.reference = require("./reference.js").reference;
1919
exports.revwalk = require("./revwalk.js").revwalk;
2020
exports.commit = require("./commit.js").commit;
2121
exports.tree = require("./tree.js").tree;

src/reference.cc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,16 +21,16 @@ using namespace node;
2121
void GitReference::Initialize(Handle<Object> target) {
2222
HandleScope scope;
2323

24-
Local<FunctionTemplate> t = FunctionTemplate::New(New);
24+
Local<FunctionTemplate> tpl = FunctionTemplate::New(New);
2525

26-
constructor_template = Persistent<FunctionTemplate>::New(t);
27-
constructor_template->InstanceTemplate()->SetInternalFieldCount(1);
28-
constructor_template->SetClassName(String::NewSymbol("Ref"));
26+
tpl->InstanceTemplate()->SetInternalFieldCount(1);
27+
tpl->SetClassName(String::NewSymbol("Reference"));
2928

30-
NODE_SET_PROTOTYPE_METHOD(constructor_template, "oid", Oid);
31-
NODE_SET_PROTOTYPE_METHOD(constructor_template, "lookup", Lookup);
29+
NODE_SET_PROTOTYPE_METHOD(tpl, "oid", Oid);
30+
NODE_SET_PROTOTYPE_METHOD(tpl, "lookup", Lookup);
3231

33-
target->Set(String::NewSymbol("Ref"), constructor_template->GetFunction());
32+
constructor_template = Persistent<Function>::New(tpl->GetFunction());
33+
target->Set(String::NewSymbol("Reference"), constructor_template);
3434
}
3535

3636
git_reference* GitReference::GetValue() {

0 commit comments

Comments
 (0)