diff --git a/common/dialogs/git/dialog_git_repository.cpp b/common/dialogs/git/dialog_git_repository.cpp index 4e71fef273..3540dba34a 100644 --- a/common/dialogs/git/dialog_git_repository.cpp +++ b/common/dialogs/git/dialog_git_repository.cpp @@ -56,7 +56,8 @@ DIALOG_GIT_REPOSITORY::DIALOG_GIT_REPOSITORY( wxWindow* aParent, git_repository* m_tempRepo = true; m_tempPath = wxFileName::CreateTempFileName( "kicadtestrepo" ); - git_repository_init_options options = GIT_REPOSITORY_INIT_OPTIONS_INIT; + git_repository_init_options options; + git_repository_init_init_options( &options, GIT_REPOSITORY_INIT_OPTIONS_VERSION ); options.flags = GIT_REPOSITORY_INIT_MKPATH | GIT_REPOSITORY_INIT_NO_REINIT; git_repository_init_ext( &m_repository, m_tempPath.ToStdString().c_str(), &options ); } @@ -260,7 +261,8 @@ void DIALOG_GIT_REPOSITORY::updateURLData() void DIALOG_GIT_REPOSITORY::OnTestClick( wxCommandEvent& event ) { git_remote* remote = nullptr; - git_remote_callbacks callbacks = GIT_REMOTE_CALLBACKS_INIT; + git_remote_callbacks callbacks; + git_remote_init_callbacks( &callbacks, GIT_REMOTE_CALLBACKS_VERSION ); // We track if we have already tried to connect. // If we have, the server may come back to offer another connection diff --git a/common/dialogs/git/dialog_git_repository.h b/common/dialogs/git/dialog_git_repository.h index 6d851c35eb..ba807f6f5a 100644 --- a/common/dialogs/git/dialog_git_repository.h +++ b/common/dialogs/git/dialog_git_repository.h @@ -121,8 +121,6 @@ private: bool m_tempRepo; wxString m_tempPath; - - KIGIT_COMMON::GIT_CONN_TYPE m_repoType; }; #endif /* DIALOG_GIT_REPOSITORY_H_ */ \ No newline at end of file diff --git a/common/git/git_clone_handler.cpp b/common/git/git_clone_handler.cpp index a466b69181..4469f5c29c 100644 --- a/common/git/git_clone_handler.cpp +++ b/common/git/git_clone_handler.cpp @@ -51,7 +51,8 @@ bool GIT_CLONE_HANDLER::PerformClone() } } - git_clone_options cloneOptions = GIT_CLONE_OPTIONS_INIT; + git_clone_options cloneOptions; + git_clone_init_options( &cloneOptions, GIT_CLONE_OPTIONS_VERSION ); cloneOptions.checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; cloneOptions.checkout_opts.progress_cb = clone_progress_cb; cloneOptions.checkout_opts.progress_payload = this; diff --git a/common/git/git_pull_handler.cpp b/common/git/git_pull_handler.cpp index 3d603d010e..a395672fd4 100644 --- a/common/git/git_pull_handler.cpp +++ b/common/git/git_pull_handler.cpp @@ -47,7 +47,8 @@ bool GIT_PULL_HANDLER::PerformFetch() return false; } - git_remote_callbacks remoteCallbacks = GIT_REMOTE_CALLBACKS_INIT; + git_remote_callbacks remoteCallbacks; + git_remote_init_callbacks( &remoteCallbacks, GIT_REMOTE_CALLBACKS_VERSION ); remoteCallbacks.sideband_progress = progress_cb; remoteCallbacks.transfer_progress = transfer_progress_cb; remoteCallbacks.credentials = credentials_cb; @@ -60,7 +61,8 @@ bool GIT_PULL_HANDLER::PerformFetch() return false; } - git_fetch_options fetchOptions = GIT_FETCH_OPTIONS_INIT; + git_fetch_options fetchOptions; + git_fetch_init_options( &fetchOptions, GIT_FETCH_OPTIONS_VERSION ); fetchOptions.callbacks = remoteCallbacks; if( git_remote_fetch( remote, nullptr, &fetchOptions, nullptr ) ) @@ -188,7 +190,8 @@ PullResult GIT_PULL_HANDLER::handleFastForward() return PullResult::Error; } - git_checkout_options checkoutOptions = GIT_CHECKOUT_OPTIONS_INIT; + git_checkout_options checkoutOptions; + git_checkout_init_options( &checkoutOptions, GIT_CHECKOUT_OPTIONS_VERSION ); checkoutOptions.checkout_strategy = GIT_CHECKOUT_SAFE; if( git_checkout_head( m_repo, &checkoutOptions ) ) { @@ -239,8 +242,11 @@ PullResult GIT_PULL_HANDLER::handleFastForward() PullResult GIT_PULL_HANDLER::handleMerge( const git_annotated_commit** aMergeHeads, size_t aMergeHeadsCount ) { - git_merge_options merge_opts = GIT_MERGE_OPTIONS_INIT; - git_checkout_options checkout_opts = GIT_CHECKOUT_OPTIONS_INIT; + git_merge_options merge_opts; + git_merge_options_init( &merge_opts, GIT_MERGE_OPTIONS_VERSION ); + + git_checkout_options checkout_opts; + git_checkout_init_options( &checkout_opts, GIT_CHECKOUT_OPTIONS_VERSION ); checkout_opts.checkout_strategy = GIT_CHECKOUT_SAFE; diff --git a/common/git/git_push_handler.cpp b/common/git/git_push_handler.cpp index 325ce2687f..516ae1592c 100644 --- a/common/git/git_push_handler.cpp +++ b/common/git/git_push_handler.cpp @@ -45,7 +45,8 @@ PushResult GIT_PUSH_HANDLER::PerformPush() return PushResult::Error; } - git_remote_callbacks remoteCallbacks = GIT_REMOTE_CALLBACKS_INIT; + git_remote_callbacks remoteCallbacks; + git_remote_init_callbacks( &remoteCallbacks, GIT_REMOTE_CALLBACKS_VERSION ); remoteCallbacks.sideband_progress = progress_cb; remoteCallbacks.transfer_progress = transfer_progress_cb; remoteCallbacks.update_tips = update_cb; @@ -59,7 +60,8 @@ PushResult GIT_PUSH_HANDLER::PerformPush() return PushResult::Error; } - git_push_options pushOptions = GIT_PUSH_OPTIONS_INIT; + git_push_options pushOptions; + git_push_init_options( &pushOptions, GIT_PUSH_OPTIONS_VERSION ); pushOptions.callbacks = remoteCallbacks; if( git_remote_push( remote, nullptr, &pushOptions ) ) diff --git a/common/git/git_revert_handler.cpp b/common/git/git_revert_handler.cpp index baf6b2a327..df4744ced3 100644 --- a/common/git/git_revert_handler.cpp +++ b/common/git/git_revert_handler.cpp @@ -63,7 +63,8 @@ static int checkout_notify_cb(git_checkout_notify_t why, const char *path, void GIT_REVERT_HANDLER::PerformRevert() { git_object* head_commit = NULL; - git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT; + git_checkout_options opts; + git_checkout_init_options(&opts, GIT_CHECKOUT_OPTIONS_VERSION); // Get the HEAD commit if (git_revparse_single(&head_commit, m_repository, "HEAD") != 0) { diff --git a/common/git/kicad_git_common.cpp b/common/git/kicad_git_common.cpp index f34154c5df..f7425d4369 100644 --- a/common/git/kicad_git_common.cpp +++ b/common/git/kicad_git_common.cpp @@ -252,7 +252,8 @@ std::pair,std::set> KIGIT_COMMON::GetDifferentFiles git_diff* diff; - git_diff_options diff_opts = GIT_DIFF_OPTIONS_INIT; + git_diff_options diff_opts; + git_diff_init_options( &diff_opts, GIT_DIFF_OPTIONS_VERSION ); if( git_diff_tree_to_tree( &diff, m_repo, parent_tree, tree, &diff_opts ) == GIT_OK ) { diff --git a/kicad/project_tree_pane.cpp b/kicad/project_tree_pane.cpp index 58ea02aab9..2164407fbb 100644 --- a/kicad/project_tree_pane.cpp +++ b/kicad/project_tree_pane.cpp @@ -712,7 +712,8 @@ bool PROJECT_TREE_PANE::hasChangedFiles() if( !repo ) return false; - git_status_options opts = GIT_STATUS_OPTIONS_INIT; + git_status_options opts; + git_status_init_options( &opts, GIT_STATUS_OPTIONS_VERSION ); opts.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; opts.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX @@ -1947,7 +1948,8 @@ void PROJECT_TREE_PANE::updateGitStatusIcons() } } - git_status_options status_options = GIT_STATUS_OPTIONS_INIT; + git_status_options status_options; + git_status_init_options( &status_options, GIT_STATUS_OPTIONS_VERSION ); status_options.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; status_options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_INCLUDE_UNMODIFIED; @@ -2097,7 +2099,8 @@ void PROJECT_TREE_PANE::onGitCommit( wxCommandEvent& aEvent ) git_config_free( config ); // Collect modified files in the repository - git_status_options status_options = GIT_STATUS_OPTIONS_INIT; + git_status_options status_options; + git_status_init_options( &status_options, GIT_STATUS_OPTIONS_VERSION ); status_options.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; status_options.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED;