Permalink
Browse files

Removed object

  • Loading branch information...
faceleg committed Apr 3, 2013
1 parent 0c2abc9 commit 628a944e831efd95d9adebfd85873da666b078bc
Showing with 3 additions and 416 deletions.
  1. +0 −1 binding.gyp
  2. +1 −0 include/blob.h
  3. +2 −1 include/diff_list.h
  4. +0 −95 include/object.h
  5. +0 −3 include/repo.h
  6. +0 −1 include/tree_entry.h
  7. +0 −1 lib/index.js
  8. +0 −71 lib/object.js
  9. +0 −2 src/base.cc
  10. +0 −201 src/object.cc
  11. +0 −1 src/repo.cc
  12. +0 −1 src/tree_entry.cc
  13. +0 −38 test/raw-object.js
View
@@ -7,7 +7,6 @@
'src/blob.cc',
'src/commit.cc',
'src/error.cc',
- 'src/object.cc',
'src/oid.cc',
'src/reference.cc',
'src/repo.cc',
View
@@ -15,6 +15,7 @@
#include "git2.h"
#include "repo.h"
+#include "oid.h"
using namespace v8;
using namespace node;
View
@@ -13,7 +13,8 @@
#include "git2.h"
-#include "../include/repo.h"
+#include "repo.h"
+#include "oid.h"
using namespace node;
using namespace v8;
View
@@ -1,95 +0,0 @@
-/*
- * Copyright 2013, Tim Branyen @tbranyen <tim@tabdeveloper.com>
- * @author Michael Robinson @codeofinterest <mike@pagesofinterest.net>
- *
- * Dual licensed under the MIT and GPL licenses.
- */
-
-#ifndef OBJ_H
-#define OBJ_H
-
-#include <v8.h>
-#include <node.h>
-
-#include "git2.h"
-
-#include "repo.h"
-#include "oid.h"
-
-using namespace node;
-
-/**
- * Class wrapper for libgit2 git_object
- */
-class GitObject : public ObjectWrap {
- public:
- /**
- * v8::FunctionTemplate used to create Node.js constructor
- */
- static Persistent<Function> constructor_template;
-
- /**
- * Used to intialize the EventEmitter from Node.js
- *
- * @param target v8::Object the Node.js module object
- */
- static void Initialize(Handle<v8::Object> target);
-
- /**
- * Accessor for Object
- *
- * @return the internal git_object reference
- */
- git_object* GetValue();
-
- /**
- * Mutator for Object
- *
- * @param obj a git_object object
- */
- void SetValue(git_object* obj);
-
- const git_oid* Id();
- git_otype Type();
-
- git_repository* Owner();
- const char* Type2String(git_otype type);
- git_otype String2Type(const char* type);
- int TypeIsLoose(git_otype type);
- size_t Size(git_otype type);
-
- protected:
- /**
- * Constructor
- */
- GitObject() {};
-
- /**
- * Deconstructor
- */
- ~GitObject() {};
-
- /**
- * Mutator for GitObject
- *
- * @param args v8::Arguments function call arguments from Node.js
- *
- * @return v8::Object args.This()
- */
- static Handle<Value> New(const Arguments& args);
- static Handle<Value> Id(const Arguments& args);
- static Handle<Value> Type(const Arguments& args);
- static Handle<Value> Owner(const Arguments& args);
- static Handle<Value> Type2String(const Arguments& args);
- static Handle<Value> String2Type(const Arguments& args);
- static Handle<Value> TypeIsLoose(const Arguments& args);
- static Handle<Value> Size(const Arguments& args);
-
- private:
- /**
- * Internal reference to git_object object
- */
- git_object* obj;
-};
-
-#endif
View
@@ -14,8 +14,6 @@
#include "git2.h"
-#include "object.h"
-
using namespace node;
using namespace v8;
@@ -27,7 +25,6 @@ class GitRepo : public ObjectWrap {
git_repository* GetValue();
void SetValue(git_repository* repo);
- // Synchronous
void Free();
protected:
View
@@ -17,7 +17,6 @@
#include "repo.h"
#include "tree.h"
#include "oid.h"
-#include "object.h"
using namespace v8;
using namespace node;
View
@@ -14,7 +14,6 @@ exports.blob = require('./blob.js').blob;
exports.repo = require('./repo.js').repo;
exports.signature = require('./signature.js').signature;
exports.oid = require('./oid.js').oid;
-exports.object = require('./object.js').object;
exports.reference = require('./reference.js').reference;
exports.revwalk = require('./revwalk.js').revwalk;
exports.commit = require('./commit.js').commit;
View
@@ -1,71 +0,0 @@
-var git = require( '../' );
-
-var _Object = function( obj ) {
- var self = {};
-
- if( object instanceof git.raw.Object ) {
- self.object = obj;
- }
- else {
- self.object = new git.raw.Object();
- }
-
- Object.defineProperty( self, 'id', {
- get: function() {
- },
- enumerable: true
- });
-
- Object.defineProperty( self, 'type', {
- get: function() {
- return self.object.type();
- },
- enumerable: true
- });
-
- Object.defineProperty( self, 'length', {
- get: function() {
- return self.object.size();
- },
- enumerable: true
- });
-
- Object.defineProperty( self, 'isLoose', {
- get: function() {
- return self.object.typeIsLoose();
- },
- enumerable: true
- });
-
- self.id = function() {
- var oid = git.oid();
-
- self.object.id( oid.oid );
-
- return oid;
- };
-
- self.owner = function() {
- var repo = git.repo();
-
- self.object.owner( repo.repo );
-
- return repo;
- };
-
- self.toString = function() {
- return self.object.type2String();
- };
-
- self.toType = function( type ) {
- return self.object.toType( type );
- };
-
- self.free = function() {
- return self.object.free();
- };
-
- return self;
-};
-
-exports.object = _Object;
View
@@ -16,7 +16,6 @@
#include "../include/blob.h"
#include "../include/repo.h"
#include "../include/oid.h"
-#include "../include/object.h"
#include "../include/commit.h"
#include "../include/revwalk.h"
#include "../include/tree.h"
@@ -33,7 +32,6 @@ extern "C" void init(Handle<v8::Object> target) {
GitSignature::Initialize(target);
GitBlob::Initialize(target);
GitOid::Initialize(target);
- GitObject::Initialize(target);
GitRepo::Initialize(target);
GitCommit::Initialize(target);
GitRevWalk::Initialize(target);
Oops, something went wrong.

0 comments on commit 628a944

Please sign in to comment.