@@ -83,6 +83,8 @@ git_index *GitIndex::GetValue() {
8383}
8484
8585
86+ #include " ../include/functions/copy.h"
87+
8688/* *
8789 * @param {String} index_path
8890 * @param {Index} callback
@@ -121,7 +123,7 @@ void GitIndex::OpenWork(uv_work_t *req) {
121123 );
122124 baton->error_code = result;
123125 if (result != GIT_OK) {
124- baton->error = giterr_last ();
126+ baton->error = git_error_dup ( giterr_last () );
125127 }
126128}
127129
@@ -163,6 +165,8 @@ void GitIndex::OpenAfterWork(uv_work_t *req) {
163165 delete baton;
164166}
165167
168+ #include " ../include/functions/copy.h"
169+
166170/* *
167171 */
168172Handle<Value> GitIndex::Read (const Arguments& args) {
@@ -192,7 +196,7 @@ void GitIndex::ReadWork(uv_work_t *req) {
192196 );
193197 baton->error_code = result;
194198 if (result != GIT_OK) {
195- baton->error = giterr_last ();
199+ baton->error = git_error_dup ( giterr_last () );
196200 }
197201}
198202
@@ -227,6 +231,8 @@ void GitIndex::ReadAfterWork(uv_work_t *req) {
227231 delete baton;
228232}
229233
234+ #include " ../include/functions/copy.h"
235+
230236/* *
231237 */
232238Handle<Value> GitIndex::Write (const Arguments& args) {
@@ -256,7 +262,7 @@ void GitIndex::WriteWork(uv_work_t *req) {
256262 );
257263 baton->error_code = result;
258264 if (result != GIT_OK) {
259- baton->error = giterr_last ();
265+ baton->error = git_error_dup ( giterr_last () );
260266 }
261267}
262268
@@ -291,6 +297,8 @@ void GitIndex::WriteAfterWork(uv_work_t *req) {
291297 delete baton;
292298}
293299
300+ #include " ../include/functions/copy.h"
301+
294302/* *
295303 * @param {Tree} tree
296304 */
@@ -329,7 +337,7 @@ void GitIndex::ReadTreeWork(uv_work_t *req) {
329337 );
330338 baton->error_code = result;
331339 if (result != GIT_OK) {
332- baton->error = giterr_last ();
340+ baton->error = git_error_dup ( giterr_last () );
333341 }
334342}
335343
@@ -365,6 +373,8 @@ void GitIndex::ReadTreeAfterWork(uv_work_t *req) {
365373 delete baton;
366374}
367375
376+ #include " ../include/functions/copy.h"
377+
368378/* *
369379 * @param {Oid} callback
370380 */
@@ -397,7 +407,7 @@ void GitIndex::WriteTreeWork(uv_work_t *req) {
397407 );
398408 baton->error_code = result;
399409 if (result != GIT_OK) {
400- baton->error = giterr_last ();
410+ baton->error = git_error_dup ( giterr_last () );
401411 }
402412}
403413
@@ -570,6 +580,8 @@ Handle<Value> GitIndex::RemoveDirectory(const Arguments& args) {
570580 return Undefined ();
571581}
572582
583+ #include " ../include/functions/copy.h"
584+
573585/* *
574586 * @param {String} path
575587 */
@@ -609,7 +621,7 @@ void GitIndex::AddBypathWork(uv_work_t *req) {
609621 );
610622 baton->error_code = result;
611623 if (result != GIT_OK) {
612- baton->error = giterr_last ();
624+ baton->error = git_error_dup ( giterr_last () );
613625 }
614626}
615627
@@ -760,6 +772,8 @@ Handle<Value> GitIndex::HasConflicts(const Arguments& args) {
760772 return scope.Close (to);
761773}
762774
775+ #include " ../include/functions/copy.h"
776+
763777/* *
764778 * @param {Repository} repo
765779 * @param {Index} index
@@ -815,7 +829,7 @@ void GitIndex::IndexToWorkdirWork(uv_work_t *req) {
815829 );
816830 baton->error_code = result;
817831 if (result != GIT_OK) {
818- baton->error = giterr_last ();
832+ baton->error = git_error_dup ( giterr_last () );
819833 }
820834}
821835
0 commit comments