@@ -61,6 +61,157 @@ class GitRepo : public ObjectWrap {
6161 };
6262 static Handle<Value> Path (const Arguments& args);
6363 static Handle<Value> Workdir (const Arguments& args);
64+ static Handle<Value> GetBlob (const Arguments& args);
65+ static void GetBlobWork (uv_work_t * req);
66+ static void GetBlobAfterWork (uv_work_t * req);
67+
68+ struct GetBlobBaton {
69+ uv_work_t request;
70+ int error_code;
71+ const git_error* error;
72+ git_blob * blob;
73+ Persistent<Value> repoReference;
74+ git_repository * repo;
75+ Persistent<Value> idReference;
76+ const git_oid * id;
77+ Persistent<Function> callback;
78+ };
79+ static Handle<Value> GetCommit (const Arguments& args);
80+ static void GetCommitWork (uv_work_t * req);
81+ static void GetCommitAfterWork (uv_work_t * req);
82+
83+ struct GetCommitBaton {
84+ uv_work_t request;
85+ int error_code;
86+ const git_error* error;
87+ git_commit * commit;
88+ Persistent<Value> repoReference;
89+ git_repository * repo;
90+ Persistent<Value> idReference;
91+ const git_oid * id;
92+ Persistent<Function> callback;
93+ };
94+ static Handle<Value> GetObject (const Arguments& args);
95+ static void GetObjectWork (uv_work_t * req);
96+ static void GetObjectAfterWork (uv_work_t * req);
97+
98+ struct GetObjectBaton {
99+ uv_work_t request;
100+ int error_code;
101+ const git_error* error;
102+ git_object * object;
103+ Persistent<Value> repoReference;
104+ git_repository * repo;
105+ Persistent<Value> idReference;
106+ const git_oid * id;
107+ Persistent<Value> typeReference;
108+ git_otype type;
109+ Persistent<Function> callback;
110+ };
111+ static Handle<Value> GetReference (const Arguments& args);
112+ static void GetReferenceWork (uv_work_t * req);
113+ static void GetReferenceAfterWork (uv_work_t * req);
114+
115+ struct GetReferenceBaton {
116+ uv_work_t request;
117+ int error_code;
118+ const git_error* error;
119+ git_reference * out;
120+ Persistent<Value> repoReference;
121+ git_repository * repo;
122+ Persistent<Value> nameReference;
123+ const char * name;
124+ Persistent<Function> callback;
125+ };
126+ static Handle<Value> CreateSymbolicReference (const Arguments& args);
127+ static Handle<Value> CreateReference (const Arguments& args);
128+ static Handle<Value> CreateRevWalk (const Arguments& args);
129+ static Handle<Value> GetSubmodule (const Arguments& args);
130+ static Handle<Value> AddSubmodule (const Arguments& args);
131+ static Handle<Value> GetTag (const Arguments& args);
132+ static void GetTagWork (uv_work_t * req);
133+ static void GetTagAfterWork (uv_work_t * req);
134+
135+ struct GetTagBaton {
136+ uv_work_t request;
137+ int error_code;
138+ const git_error* error;
139+ git_tag * out;
140+ Persistent<Value> repoReference;
141+ git_repository * repo;
142+ Persistent<Value> idReference;
143+ const git_oid * id;
144+ Persistent<Function> callback;
145+ };
146+ static Handle<Value> CreateTag (const Arguments& args);
147+ static void CreateTagWork (uv_work_t * req);
148+ static void CreateTagAfterWork (uv_work_t * req);
149+
150+ struct CreateTagBaton {
151+ uv_work_t request;
152+ int error_code;
153+ const git_error* error;
154+ git_oid * oid;
155+ Persistent<Value> repoReference;
156+ git_repository * repo;
157+ Persistent<Value> tag_nameReference;
158+ const char * tag_name;
159+ Persistent<Value> targetReference;
160+ const git_object * target;
161+ Persistent<Value> taggerReference;
162+ const git_signature * tagger;
163+ Persistent<Value> messageReference;
164+ const char * message;
165+ Persistent<Value> forceReference;
166+ int force;
167+ Persistent<Function> callback;
168+ };
169+ static Handle<Value> CreateLightweightTag (const Arguments& args);
170+ static void CreateLightweightTagWork (uv_work_t * req);
171+ static void CreateLightweightTagAfterWork (uv_work_t * req);
172+
173+ struct CreateLightweightTagBaton {
174+ uv_work_t request;
175+ int error_code;
176+ const git_error* error;
177+ git_oid * oid;
178+ Persistent<Value> repoReference;
179+ git_repository * repo;
180+ Persistent<Value> tag_nameReference;
181+ const char * tag_name;
182+ Persistent<Value> targetReference;
183+ const git_object * target;
184+ Persistent<Value> forceReference;
185+ int force;
186+ Persistent<Function> callback;
187+ };
188+ static Handle<Value> GetTree (const Arguments& args);
189+ static void GetTreeWork (uv_work_t * req);
190+ static void GetTreeAfterWork (uv_work_t * req);
191+
192+ struct GetTreeBaton {
193+ uv_work_t request;
194+ int error_code;
195+ const git_error* error;
196+ git_tree * out;
197+ Persistent<Value> repoReference;
198+ git_repository * repo;
199+ Persistent<Value> idReference;
200+ const git_oid * id;
201+ Persistent<Function> callback;
202+ };
203+ static Handle<Value> ReloadSubmodules (const Arguments& args);
204+ static void ReloadSubmodulesWork (uv_work_t * req);
205+ static void ReloadSubmodulesAfterWork (uv_work_t * req);
206+
207+ struct ReloadSubmodulesBaton {
208+ uv_work_t request;
209+ int error_code;
210+ const git_error* error;
211+ Persistent<Value> repoReference;
212+ git_repository * repo;
213+ Persistent<Function> callback;
214+ };
64215 git_repository *raw;
65216};
66217
0 commit comments