Skip to content

Commit

Permalink
Removed unused 'completion' callback
Browse files Browse the repository at this point in the history
  • Loading branch information
jacquesg committed May 2, 2014
1 parent 76cb876 commit f1f0c29
Show file tree
Hide file tree
Showing 5 changed files with 1 addition and 66 deletions.
46 changes: 0 additions & 46 deletions Raw.xs
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,6 @@

typedef struct {
SV *progress;
SV *completion;
SV *credentials;
SV *transfer_progress;
SV *update_tips;
Expand Down Expand Up @@ -336,7 +335,6 @@ on_error:
STATIC void git_init_remote_callbacks(git_raw_remote_callbacks *cbs) {
cbs -> credentials = NULL;
cbs -> progress = NULL;
cbs -> completion = NULL;
cbs -> transfer_progress = NULL;
cbs -> update_tips = NULL;
}
Expand All @@ -352,11 +350,6 @@ STATIC void git_clean_remote_callbacks(git_raw_remote_callbacks *cbs) {
cbs -> progress = NULL;
}

if (cbs -> completion) {
SvREFCNT_dec(cbs -> completion);
cbs -> completion = NULL;
}

if (cbs -> transfer_progress) {
SvREFCNT_dec(cbs -> transfer_progress);
cbs -> transfer_progress = NULL;
Expand Down Expand Up @@ -994,45 +987,6 @@ STATIC int git_progress_cbb(const char *str, int len, void *cbs) {
return 0;
}

STATIC int git_completion_cbb(git_remote_completion_type type, void *cbs) {
dSP;
SV* ct;

switch (type) {
case GIT_REMOTE_COMPLETION_DOWNLOAD:
ct = newSVpv("download", 0);
break;

case GIT_REMOTE_COMPLETION_INDEXING:
ct = newSVpv("indexing", 0);
break;

case GIT_REMOTE_COMPLETION_ERROR:
ct = newSVpv("error", 0);
break;

default:
Perl_croak(aTHX_ "Unhandled completion type");
break;
}

ENTER;
SAVETMPS;

PUSHMARK(SP);
mXPUSHs(ct);
PUTBACK;

call_sv(((git_raw_remote_callbacks *) cbs) -> completion, G_DISCARD);

SPAGAIN;

FREETMPS;
LEAVE;

return 0;
}

STATIC int git_transfer_progress_cbb(const git_transfer_progress *stats, void *cbs) {
dSP;

Expand Down
5 changes: 0 additions & 5 deletions lib/Git/Raw/Remote.pm
Original file line number Diff line number Diff line change
Expand Up @@ -141,11 +141,6 @@ Textual progress from the remote. Text send over the progress side-band will be
passed to this function (this is the 'counting objects' output). The callback
receives a string containing progress information.
=item * "completion"
Completion is called when different parts of the download process are done
(currently unused).
=item * "transfer_progress"
During the download of new data, this will be regularly called with the current
Expand Down
5 changes: 0 additions & 5 deletions lib/Git/Raw/Repository.pm
Original file line number Diff line number Diff line change
Expand Up @@ -88,11 +88,6 @@ Textual progress from the remote. Text send over the progress side-band will be
passed to this function (this is the 'counting objects' output). The callback
receives a string containing progress information.
=item * "completion"
Completion is called when different parts of the download process are done
(currently unused).
=item * "transfer_progress"
During the download of new data, this will be regularly called with the current
Expand Down
4 changes: 0 additions & 4 deletions xs/Remote.xs
Original file line number Diff line number Diff line change
Expand Up @@ -363,10 +363,6 @@ callbacks(self, callbacks)
get_callback_option(callbacks, "sideband_progress")))
rcallbacks.sideband_progress = git_progress_cbb;

if ((remote -> callbacks.completion =
get_callback_option(callbacks, "completion")))
rcallbacks.completion = git_completion_cbb;

if ((remote -> callbacks.transfer_progress =
get_callback_option(callbacks, "transfer_progress")))
rcallbacks.transfer_progress = git_transfer_progress_cbb;
Expand Down
7 changes: 1 addition & 6 deletions xs/Repository.xs
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ clone(class, url, path, opts)
HV *callbacks;
Repository repo;

git_raw_remote_callbacks cbs = {0, 0, 0, 0, 0};
git_raw_remote_callbacks cbs = {0, 0, 0, 0};
git_clone_options clone_opts = GIT_CLONE_OPTIONS_INIT;

CODE:
Expand Down Expand Up @@ -67,11 +67,6 @@ clone(class, url, path, opts)
clone_opts.remote_callbacks.sideband_progress =
git_progress_cbb;

if ((cbs.completion =
get_callback_option(callbacks, "completion")))
clone_opts.remote_callbacks.completion =
git_completion_cbb;

if ((cbs.transfer_progress =
get_callback_option(callbacks, "transfer_progress")))
clone_opts.remote_callbacks.transfer_progress =
Expand Down

0 comments on commit f1f0c29

Please sign in to comment.