9 Commits

Author SHA1 Message Date
Twarit Waikar
2f160a2b79 Merge pull request #189 from fries1234/fix-comparison-bug
fix a comparision bug with renamed git statuses
2023-10-03 20:09:42 +05:30
Hugo Locurcio
55b09bf0f7 Merge pull request #198 from jokoho48/gd4_1 2023-09-22 21:47:26 +02:00
Jonas Hoffmann
ae2f2d3826 Add Godot 4.1 Support
- Update godot-cpp
- Fix Entry Point that changed within Godot 4.1
- Add compatibility_minimum to gdextension required for 4.1 support
- Bump version in plugin.cfg
- Upgrade demo project to 4.1
2023-07-12 22:12:15 +02:00
Twarit Waikar
3fc541feb8 Merge pull request #173 from markeel/master
Address issue #172, to use public key path if present in preference to using password.
2023-05-25 12:58:09 +05:30
markeel
04602dc5dc Merge pull request #1 from markeel/workflow-error
Update build.yml
2023-05-24 14:14:41 -07:00
markeel
bb5da70aa4 Update build.yml
Fix ubuntu version to match godot-cpp
2023-05-24 13:30:47 -07:00
Fries
4cb6ec0edd fix a comparision bug with renamed git statuses
there is a bug where if you have a entry->status with GIT_STATUS_INDEX_RENAMED but with another flag like GIT_STATUS_INDEX_MODIFIED, godot-git-plugin will crash as it cant find the proper map for 2 flags. so i changed it to do a logical and so it can execute the proper renamed logic.
2023-05-18 23:28:08 -07:00
mendrak
34850841fc Updated to remove extra line and pass clang format check 2023-03-26 20:44:58 -07:00
mendrak
74342b298e Address issue #172, to use public key path if present in preference
to using password.
2023-03-25 09:36:43 -07:00
9 changed files with 19 additions and 15 deletions

View File

@@ -4,7 +4,7 @@ on: [push, pull_request]
jobs:
linux-x64:
runs-on: ubuntu-18.04
runs-on: ubuntu-20.04
steps:
- uses: actions/checkout@v2
- name: build-linux-editor-x64

1
.gitmodules vendored
View File

@@ -5,6 +5,7 @@
[submodule "libgit2"]
path = thirdparty/git2/libgit2
url = https://github.com/libgit2/libgit2
ignore = untracked
[submodule "thirdparty/ssh2/libssh2"]
path = thirdparty/ssh2/libssh2
url = https://github.com/libssh2/libssh2

View File

@@ -1,6 +1,7 @@
[configuration]
entry_symbol = "git_plugin_init"
compatibility_minimum = "4.1.0"
[libraries]

View File

@@ -3,5 +3,5 @@
name="Godot Git Plugin"
description="This plugin lets you interact with Git without leaving the Godot editor. More information can be found at https://github.com/godotengine/godot-git-plugin/wiki"
author="twaritwaikar"
version="v3.0.0-beta1"
version="v3.0.1"
script="godot-git-plugin.gd"

View File

@@ -10,7 +10,7 @@ config_version=5
[application]
config/features=PackedStringArray("4.0")
config/features=PackedStringArray("4.1")
[editor]

View File

@@ -19,8 +19,8 @@ void uninitialize_git_plugin_module(godot::ModuleInitializationLevel p_level) {
extern "C" {
GDExtensionBool GDE_EXPORT git_plugin_init(const GDExtensionInterface *p_interface, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
godot::GDExtensionBinding::InitObject init_obj(p_interface, p_library, r_initialization);
GDExtensionBool GDE_EXPORT git_plugin_init(const GDExtensionInterfaceGetProcAddress p_address, const GDExtensionClassLibraryPtr p_library, GDExtensionInitialization *r_initialization) {
godot::GDExtensionBinding::InitObject init_obj(p_address, p_library, r_initialization);
init_obj.register_initializer(initialize_git_plugin_module);
init_obj.register_terminator(uninitialize_git_plugin_module);

View File

@@ -82,16 +82,18 @@ extern "C" int credentials_cb(git_cred **out, const char *url, const char *usern
godot::String proper_username = username_from_url ? username_from_url : creds->username;
if (allowed_types & GIT_CREDENTIAL_USERPASS_PLAINTEXT) {
return git_cred_userpass_plaintext_new(out, CString(proper_username).data, CString(creds->password).data);
if (!creds->ssh_public_key_path.is_empty()) {
if (allowed_types & GIT_CREDENTIAL_SSH_KEY) {
return git_credential_ssh_key_new(out,
CString(proper_username).data,
CString(creds->ssh_public_key_path).data,
CString(creds->ssh_private_key_path).data,
CString(creds->ssh_passphrase).data);
}
}
if (allowed_types & GIT_CREDENTIAL_SSH_KEY) {
return git_credential_ssh_key_new(out,
CString(proper_username).data,
CString(creds->ssh_public_key_path).data,
CString(creds->ssh_private_key_path).data,
CString(creds->ssh_passphrase).data);
if (allowed_types & GIT_CREDENTIAL_USERPASS_PLAINTEXT) {
return git_cred_userpass_plaintext_new(out, CString(proper_username).data, CString(creds->password).data);
}
if (allowed_types & GIT_CREDENTIAL_USERNAME) {

View File

@@ -245,7 +245,7 @@ godot::TypedArray<godot::Dictionary> GitPlugin::_get_modified_files_data() {
}
if (entry->status & git_status_index) {
if (entry->status == GIT_STATUS_INDEX_RENAMED) {
if (entry->status & GIT_STATUS_INDEX_RENAMED) {
godot::String old_path = entry->head_to_index->old_file.path;
stats_files.push_back(create_status_file(old_path, map_changes.at(GIT_STATUS_INDEX_DELETED), TREE_AREA_STAGED));
stats_files.push_back(create_status_file(path, map_changes.at(GIT_STATUS_INDEX_NEW), TREE_AREA_STAGED));