Skip to content

Commit 271c65e

Browse files
committed
Removed unnecessary Error wrapper
1 parent 0c65472 commit 271c65e

47 files changed

Lines changed: 1426 additions & 545 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

binding.gyp

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
'src/base.cc',
77
'src/blob.cc',
88
'src/commit.cc',
9-
'src/error.cc',
109
'src/oid.cc',
1110
'src/reference.cc',
1211
'src/object.cc',
@@ -28,7 +27,6 @@
2827
'src/threads.cc',
2928
'src/wrapper.cc',
3029
'src/functions/string.cc',
31-
'src/functions/utilities.cc'
3230
],
3331

3432
'include_dirs': [

example/raw-repo.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ var git = require( '../' ).raw,
22
path = require( 'path' );
33

44

5-
var repo = new git.Repo(),
6-
error = new git.Error();
5+
var repo = new git.Repo();
76

87
// Access existing repository
98
repo.open( path.resolve( '../.git' ), function( err ) {

gen.js

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@ var idefs = JSON.parse(fs.readFileSync('v0.18.0.json')),
88

99
for (var i in idefs) {
1010
var idef = idefs[i];
11-
if (["Oid", "Blob", "Repo", "Reference", "Object", "TreeEntry", "Commit", "Signature", "Time", "Index", "Tag", "Threads", "Tree", "DiffList", "Patch", "Delta", "DiffOptions", "DiffFindOptions", "DiffFile", "DiffRange", "RevWalk"].indexOf(idef.jsClassName) > -1) {
12-
fs.writeFileSync(
13-
path.resolve("./include/" + idef.filename), headerTemplate(idef));
14-
fs.writeFileSync(
15-
path.resolve("./src/" + path.basename(idef.filename, '.h') + '.cc'), classTemplate(idef));
16-
}
11+
if (idef.ignore) continue;
12+
13+
fs.writeFileSync(
14+
path.resolve("./include/" + idef.filename), headerTemplate(idef));
15+
fs.writeFileSync(
16+
path.resolve("./src/" + path.basename(idef.filename, '.h') + '.cc'), classTemplate(idef));
1717
}

include/branch.h

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
/**
2+
* This code is auto-generated; unless you know what you're doing, do not modify!
3+
**/
4+
5+
#ifndef BRANCH_H
6+
#define BRANCH_H
7+
8+
#include <v8.h>
9+
#include <node.h>
10+
#include <string>
11+
12+
#include "git2.h"
13+
14+
using namespace node;
15+
using namespace v8;
16+
17+
class Branch : public ObjectWrap {
18+
public:
19+
20+
static Persistent<Function> constructor_template;
21+
static void Initialize (Handle<v8::Object> target);
22+
23+
git_branch *GetValue();
24+
25+
static Handle<Value> New(void *raw);
26+
27+
private:
28+
Branch(git_branch *raw);
29+
~Branch();
30+
31+
static Handle<Value> New(const Arguments& args);
32+
33+
34+
static Handle<Value> Create(const Arguments& args);
35+
static Handle<Value> Delete(const Arguments& args);
36+
static Handle<Value> Foreach(const Arguments& args);
37+
static Handle<Value> Move(const Arguments& args);
38+
static Handle<Value> Lookup(const Arguments& args);
39+
static Handle<Value> Name(const Arguments& args);
40+
static Handle<Value> Upstream(const Arguments& args);
41+
static Handle<Value> SetUpstream(const Arguments& args);
42+
static Handle<Value> UpstreamName(const Arguments& args);
43+
static Handle<Value> IsHead(const Arguments& args);
44+
static Handle<Value> RemoteName(const Arguments& args);
45+
git_branch *raw;
46+
};
47+
48+
#endif

include/error.h

Lines changed: 0 additions & 39 deletions
This file was deleted.

include/functions/utilities.h

Lines changed: 0 additions & 15 deletions
This file was deleted.

include/remote.h

Lines changed: 88 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,88 @@
1+
/**
2+
* This code is auto-generated; unless you know what you're doing, do not modify!
3+
**/
4+
5+
#ifndef REMOTE_H
6+
#define REMOTE_H
7+
8+
#include <v8.h>
9+
#include <node.h>
10+
#include <string>
11+
12+
#include "git2.h"
13+
14+
using namespace node;
15+
using namespace v8;
16+
17+
class Remote : public ObjectWrap {
18+
public:
19+
20+
static Persistent<Function> constructor_template;
21+
static void Initialize (Handle<v8::Object> target);
22+
23+
git_remote *GetValue();
24+
25+
static Handle<Value> New(void *raw);
26+
27+
private:
28+
Remote(git_remote *raw);
29+
~Remote();
30+
31+
static Handle<Value> New(const Arguments& args);
32+
33+
34+
static Handle<Value> Create(const Arguments& args);
35+
static void CreateWork(uv_work_t* req);
36+
static void CreateAfterWork(uv_work_t* req);
37+
38+
struct CreateBaton {
39+
uv_work_t request;
40+
int error_code;
41+
const git_error* error;
42+
git_remote * out;
43+
Persistent<Value> repoReference;
44+
git_repository * repo;
45+
Persistent<Value> nameReference;
46+
const char * name;
47+
Persistent<Value> urlReference;
48+
const char * url;
49+
Persistent<Function> callback;
50+
};
51+
static Handle<Value> CreateInmemory(const Arguments& args);
52+
static Handle<Value> Load(const Arguments& args);
53+
static Handle<Value> Save(const Arguments& args);
54+
static Handle<Value> Name(const Arguments& args);
55+
static Handle<Value> Url(const Arguments& args);
56+
static Handle<Value> Pushurl(const Arguments& args);
57+
static Handle<Value> SetUrl(const Arguments& args);
58+
static Handle<Value> SetPushurl(const Arguments& args);
59+
static Handle<Value> SetFetchspec(const Arguments& args);
60+
static Handle<Value> Fetchspec(const Arguments& args);
61+
static Handle<Value> SetPushspec(const Arguments& args);
62+
static Handle<Value> Pushspec(const Arguments& args);
63+
static Handle<Value> Connect(const Arguments& args);
64+
static Handle<Value> Ls(const Arguments& args);
65+
static Handle<Value> Download(const Arguments& args);
66+
static Handle<Value> Connected(const Arguments& args);
67+
static Handle<Value> Stop(const Arguments& args);
68+
static Handle<Value> Disconnect(const Arguments& args);
69+
static Handle<Value> Free(const Arguments& args);
70+
static Handle<Value> UpdateTips(const Arguments& args);
71+
static Handle<Value> ValidUrl(const Arguments& args);
72+
static Handle<Value> SupportedUrl(const Arguments& args);
73+
static Handle<Value> List(const Arguments& args);
74+
static Handle<Value> CheckCert(const Arguments& args);
75+
static Handle<Value> SetCredAcquireCb(const Arguments& args);
76+
static Handle<Value> SetTransport(const Arguments& args);
77+
static Handle<Value> SetCallbacks(const Arguments& args);
78+
static Handle<Value> Stats(const Arguments& args);
79+
static Handle<Value> Autotag(const Arguments& args);
80+
static Handle<Value> SetAutotag(const Arguments& args);
81+
static Handle<Value> Rename(const Arguments& args);
82+
static Handle<Value> UpdateFetchhead(const Arguments& args);
83+
static Handle<Value> SetUpdateFetchhead(const Arguments& args);
84+
static Handle<Value> IsValidName(const Arguments& args);
85+
git_remote *raw;
86+
};
87+
88+
#endif

include/utils.h

Lines changed: 0 additions & 19 deletions
This file was deleted.

lib/blob.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@ var git = require('../'),
88
* @param {git.raw.Blob} [rawBlob = new git.raw.Blob(rawRepo)] Raw blob object.
99
*/
1010
var Blob = function(rawBlob) {
11-
if(!(rawBlob instanceof git.raw.Blob)) {
12-
throw new git.error('First parameter for Blob must be a raw blob');
11+
if (!(rawBlob instanceof git.raw.Blob)) {
12+
throw new Exception('First parameter for Blob must be a raw blob');
1313
}
1414
this.rawBlob = rawBlob;
1515
};

lib/error.js

Lines changed: 0 additions & 62 deletions
This file was deleted.

0 commit comments

Comments
 (0)