Skip to content

Commit f792da5

Browse files
Merge pull request #499 from libgit2/arthur/fix-build-warnings
Fix compiler warnings
2 parents eb72aaa + 58a568c commit f792da5

File tree

2 files changed

+4
-11
lines changed

2 files changed

+4
-11
lines changed

ext/rugged/rugged_remote.c

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -514,7 +514,6 @@ static VALUE rb_git_remote_check_connection(int argc, VALUE *argv, VALUE self)
514514
static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
515515
{
516516
git_remote *remote;
517-
git_repository *repo;
518517
git_strarray refspecs;
519518
git_fetch_options opts = GIT_FETCH_OPTIONS_INIT;
520519
const git_transfer_progress *stats;
@@ -523,15 +522,13 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
523522
char *log_message = NULL;
524523
int error;
525524

526-
VALUE rb_options, rb_refspecs, rb_result = Qnil, rb_repo = rugged_owner(self);
525+
VALUE rb_options, rb_refspecs, rb_result = Qnil;
527526

528527
rb_scan_args(argc, argv, "01:", &rb_refspecs, &rb_options);
529528

530529
rugged_rb_ary_to_strarray(rb_refspecs, &refspecs);
531530

532531
Data_Get_Struct(self, git_remote, remote);
533-
rugged_check_repo(rb_repo);
534-
Data_Get_Struct(rb_repo, git_repository, repo);
535532

536533
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);
537534

@@ -594,9 +591,7 @@ static VALUE rb_git_remote_fetch(int argc, VALUE *argv, VALUE self)
594591
static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
595592
{
596593
VALUE rb_refspecs, rb_options;
597-
VALUE rb_repo = rugged_owner(self);
598594

599-
git_repository *repo;
600595
git_remote *remote;
601596
git_strarray refspecs;
602597
git_push_options opts = GIT_PUSH_OPTIONS_INIT;
@@ -609,8 +604,6 @@ static VALUE rb_git_remote_push(int argc, VALUE *argv, VALUE self)
609604

610605
rugged_rb_ary_to_strarray(rb_refspecs, &refspecs);
611606

612-
rugged_check_repo(rb_repo);
613-
Data_Get_Struct(rb_repo, git_repository, repo);
614607
Data_Get_Struct(self, git_remote, remote);
615608

616609
rugged_remote_init_callbacks_and_payload_from_options(rb_options, &opts.callbacks, &payload);

ext/rugged/rugged_submodule_collection.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -291,10 +291,10 @@ static git_submodule_update_t rb_git_subm_update_rule_toC(VALUE rb_update_rule)
291291
static VALUE rb_git_submodule_update(VALUE self, VALUE rb_name_or_submodule, VALUE rb_settings)
292292
{
293293
git_repository *repo;
294-
git_submodule_ignore_t ignore_rule;
295-
git_submodule_update_t update_rule;
294+
git_submodule_ignore_t ignore_rule = GIT_SUBMODULE_IGNORE_UNSPECIFIED;
295+
git_submodule_update_t update_rule = GIT_SUBMODULE_UPDATE_DEFAULT;
296296
const char *submodule_name;
297-
int fetch_recurse_submodules;
297+
int fetch_recurse_submodules = 0;
298298
VALUE rb_repo = rugged_owner(self);
299299
VALUE rb_url, rb_fetch_recurse_submodules, rb_ignore_rule, rb_update_rule;
300300

0 commit comments

Comments
 (0)