mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-01 01:48:28 +03:00
Add force push implementation
This commit is contained in:
@@ -1,3 +1,4 @@
|
||||
change4
|
||||
extends Node
|
||||
|
||||
|
||||
|
||||
@@ -585,7 +585,7 @@ void GitAPI::_pull(String remote, String username, String password) {
|
||||
Godot::print("GitAPI: Pull ended");
|
||||
}
|
||||
|
||||
void GitAPI::_push(String remote, String username, String password) {
|
||||
void GitAPI::_push(const String remote, const String username, const String password, const bool force) {
|
||||
Godot::print("GitAPI: Performing push to " + remote);
|
||||
|
||||
git_remote_ptr remote_object;
|
||||
@@ -614,7 +614,7 @@ void GitAPI::_push(String remote, String username, String password) {
|
||||
|
||||
String branch_name = _get_current_branch_name(true);
|
||||
|
||||
CString pushspec(String() + branch_name);
|
||||
CString pushspec(String() + (force ? "+" : "") + branch_name);
|
||||
const git_strarray refspec = { &pushspec.data, 1 };
|
||||
|
||||
git_push_options push_options = GIT_PUSH_OPTIONS_INIT;
|
||||
|
||||
@@ -91,7 +91,7 @@ class GitAPI : public EditorVCSInterface {
|
||||
bool _initialize(const String project_root_path);
|
||||
bool _is_vcs_initialized();
|
||||
void _pull(const String remote, const String username, const String password);
|
||||
void _push(const String remote, const String username, const String password);
|
||||
void _push(const String remote, const String username, const String password, const bool force);
|
||||
bool _shut_down();
|
||||
void _stage_file(const String file_path);
|
||||
void _unstage_file(const String file_path);
|
||||
|
||||
Reference in New Issue
Block a user