Skip to content

Commit ec74058

Browse files
committed
Initial remote.h functionality
1 parent baee388 commit ec74058

File tree

8 files changed

+451
-383
lines changed

8 files changed

+451
-383
lines changed

binding.gyp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
'src/odb_object.cc',
3434
'src/odb.cc',
3535
'src/submodule.cc',
36+
'src/remote.cc',
3637
'src/functions/copy.cc',
3738

3839
],

include/remote.h

Lines changed: 26 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -31,35 +31,43 @@ class GitRemote : public ObjectWrap {
3131
static Handle<Value> New(const Arguments& args);
3232

3333

34-
static Handle<Value> Save(const Arguments& args);
3534
static Handle<Value> Name(const Arguments& args);
3635
static Handle<Value> Url(const Arguments& args);
37-
static Handle<Value> Pushurl(const Arguments& args);
36+
static Handle<Value> PushUrl(const Arguments& args);
3837
static Handle<Value> SetUrl(const Arguments& args);
39-
static Handle<Value> SetPushurl(const Arguments& args);
40-
static Handle<Value> SetFetchspec(const Arguments& args);
41-
static Handle<Value> Fetchspec(const Arguments& args);
42-
static Handle<Value> SetPushspec(const Arguments& args);
43-
static Handle<Value> Pushspec(const Arguments& args);
38+
static Handle<Value> SetPushUrl(const Arguments& args);
4439
static Handle<Value> Connect(const Arguments& args);
45-
static Handle<Value> Ls(const Arguments& args);
46-
static Handle<Value> Download(const Arguments& args);
40+
static void ConnectWork(uv_work_t* req);
41+
static void ConnectAfterWork(uv_work_t* req);
42+
43+
struct ConnectBaton {
44+
uv_work_t request;
45+
int error_code;
46+
const git_error* error;
47+
Persistent<Value> remoteReference;
48+
git_remote * remote;
49+
Persistent<Value> directionReference;
50+
git_direction direction;
51+
Persistent<Function> callback;
52+
};
4753
static Handle<Value> Connected(const Arguments& args);
4854
static Handle<Value> Stop(const Arguments& args);
4955
static Handle<Value> Disconnect(const Arguments& args);
50-
static Handle<Value> Free(const Arguments& args);
56+
static void DisconnectWork(uv_work_t* req);
57+
static void DisconnectAfterWork(uv_work_t* req);
58+
59+
struct DisconnectBaton {
60+
uv_work_t request;
61+
int error_code;
62+
const git_error* error;
63+
Persistent<Value> remoteReference;
64+
git_remote * remote;
65+
Persistent<Function> callback;
66+
};
5167
static Handle<Value> UpdateTips(const Arguments& args);
5268
static Handle<Value> ValidUrl(const Arguments& args);
5369
static Handle<Value> SupportedUrl(const Arguments& args);
54-
static Handle<Value> List(const Arguments& args);
5570
static Handle<Value> CheckCert(const Arguments& args);
56-
static Handle<Value> SetCredAcquireCb(const Arguments& args);
57-
static Handle<Value> SetTransport(const Arguments& args);
58-
static Handle<Value> SetCallbacks(const Arguments& args);
59-
static Handle<Value> Stats(const Arguments& args);
60-
static Handle<Value> Autotag(const Arguments& args);
61-
static Handle<Value> SetAutotag(const Arguments& args);
62-
static Handle<Value> Rename(const Arguments& args);
6371
static Handle<Value> UpdateFetchhead(const Arguments& args);
6472
static Handle<Value> SetUpdateFetchhead(const Arguments& args);
6573
static Handle<Value> IsValidName(const Arguments& args);

include/repo.h

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,23 @@ class GitRepo : public ObjectWrap {
168168
};
169169
static Handle<Value> CreateSymbolicReference(const Arguments& args);
170170
static Handle<Value> CreateReference(const Arguments& args);
171+
static Handle<Value> AddRemote(const Arguments& args);
172+
static void AddRemoteWork(uv_work_t* req);
173+
static void AddRemoteAfterWork(uv_work_t* req);
174+
175+
struct AddRemoteBaton {
176+
uv_work_t request;
177+
int error_code;
178+
const git_error* error;
179+
git_remote * out;
180+
Persistent<Value> repoReference;
181+
git_repository * repo;
182+
Persistent<Value> nameReference;
183+
const char * name;
184+
Persistent<Value> urlReference;
185+
const char * url;
186+
Persistent<Function> callback;
187+
};
171188
static Handle<Value> CreateRevWalk(const Arguments& args);
172189
static Handle<Value> GetSubmodule(const Arguments& args);
173190
static Handle<Value> AddSubmodule(const Arguments& args);
@@ -316,6 +333,19 @@ class GitRepo : public ObjectWrap {
316333
const char * path;
317334
Persistent<Function> callback;
318335
};
336+
static Handle<Value> GetRemotes(const Arguments& args);
337+
static void GetRemotesWork(uv_work_t* req);
338+
static void GetRemotesAfterWork(uv_work_t* req);
339+
340+
struct GetRemotesBaton {
341+
uv_work_t request;
342+
int error_code;
343+
const git_error* error;
344+
git_strarray * out;
345+
Persistent<Value> repoReference;
346+
git_repository * repo;
347+
Persistent<Function> callback;
348+
};
319349
git_repository *raw;
320350
};
321351

src/base.cc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
#include "../include/odb.h"
4040
#include "../include/submodule.h"
4141
#include "../include/tree_builder.h"
42+
#include "../include/remote.h"
4243

4344
extern "C" void init(Handle<v8::Object> target) {
4445
HandleScope scope;

0 commit comments

Comments
 (0)