Skip to content

Commit df55e07

Browse files
author
Peer Allan
committed
Removes remote.prune()
1 parent 43bb61a commit df55e07

File tree

2 files changed

+1
-52
lines changed

2 files changed

+1
-52
lines changed

ext/rugged/rugged_remote.c

Lines changed: 1 addition & 46 deletions
Original file line numberDiff line numberDiff line change
@@ -555,8 +555,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
555555
log_message = StringValueCStr(rb_val);
556556

557557
VALUE rb_prune_type = rb_hash_aref(rb_options, CSTR2SYM("prune"));
558-
if (!NIL_P(rb_prune_type))
559-
opts.prune = parse_prune_type(rb_prune_type);
558+
opts.prune = parse_prune_type(rb_prune_type);
560559
}
561560

562561
error = git_remote_fetch(remote, &refspecs, &opts, log_message);
@@ -641,49 +640,6 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
641640
return payload.result;
642641
}
643642

644-
/*
645-
* call-seq:
646-
* remote.prune(options = {}) -> nil
647-
*
648-
* Prune tracking refs that are no longer present on remote
649-
*
650-
* Returns nil
651-
*
652-
* The following options can be passed in the +options+ Hash:
653-
*
654-
* :credentials ::
655-
* The credentials to use for the fetch operation. Can be either an instance of one
656-
* of the Rugged::Credentials types, or a proc returning one of the former.
657-
* The proc will be called with the +url+, the +username+ from the url (if applicable) and
658-
* a list of applicable credential types.
659-
*
660-
* Example:
661-
*
662-
* remote = Rugged::Remote.lookup(@repo, 'origin')
663-
* remote.prune()
664-
*
665-
*/
666-
static VALUE rb_git_remote_prune(int argc, VALUE *argv, VALUE self)
667-
{
668-
VALUE rb_options;
669-
git_remote *remote;
670-
git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
671-
struct rugged_remote_cb_payload payload = { Qnil, Qnil, Qnil, Qnil, Qnil, Qnil, 0 };
672-
int error;
673-
674-
Data_Get_Struct(self, git_remote, remote);
675-
rb_scan_args(argc, argv, ":", &rb_options);
676-
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);
677-
678-
if ((error = git_remote_connect(remote, GIT_DIRECTION_FETCH, &opts.callbacks)) ||
679-
(error = git_remote_prune(remote, &opts.callbacks)))
680-
git_remote_disconnect(remote);
681-
682-
rugged_exception_check(error);
683-
684-
return Qnil;
685-
}
686-
687643
void Init_rugged_remote(void)
688644
{
689645
rb_cRuggedRemote = rb_define_class_under(rb_mRugged, "Remote", rb_cObject);
@@ -698,5 +654,4 @@ void Init_rugged_remote(void)
698654
rb_define_method(rb_cRuggedRemote, "check_connection", rb_git_remote_check_connection, -1);
699655
rb_define_method(rb_cRuggedRemote, "fetch", rb_git_remote_fetch, -1);
700656
rb_define_method(rb_cRuggedRemote, "push", rb_git_remote_push, -1);
701-
rb_define_method(rb_cRuggedRemote, "prune", rb_git_remote_prune, -1);
702657
}

test/remote_test.rb

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -186,12 +186,6 @@ def setup
186186
@remote_repo.references.delete("refs/heads/unit_test")
187187
end
188188

189-
def test_remote_prune
190-
assert_equal "8496071c1b46c854b31185ea97743be6a8774479", @repo.ref("refs/remotes/origin/unit_test").target_id
191-
assert_equal nil, @remote.prune
192-
assert_nil @repo.ref("refs/remotes/origin/unit_test")
193-
end
194-
195189
def test_fetch_prune_is_forced
196190
assert_equal "8496071c1b46c854b31185ea97743be6a8774479", @repo.ref("refs/remotes/origin/unit_test").target_id
197191
@remote.fetch(prune: true)

0 commit comments

Comments
 (0)