mirror of
https://github.com/godotengine/godot-git-plugin.git
synced 2026-01-01 01:48:28 +03:00
Compare commits
5 Commits
v1.0-alpha
...
v1.0-alpha
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
b20bde7d3e | ||
|
|
0e4f8acd3d | ||
|
|
531495001e | ||
|
|
a21209bf62 | ||
|
|
cd9239220a |
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -22,32 +22,32 @@
|
||||
<VCProjectVersion>15.0</VCProjectVersion>
|
||||
<ProjectGuid>{574C5E6A-EDEC-41A6-BDF7-4106698F80B0}</ProjectGuid>
|
||||
<RootNamespace>godotgitplugin</RootNamespace>
|
||||
<WindowsTargetPlatformVersion>10.0.18362.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion>10.0</WindowsTargetPlatformVersion>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v142</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
|
||||
@@ -9,7 +9,7 @@ void GitAPI::_register_methods() {
|
||||
register_method("_process", &GitAPI::_process);
|
||||
|
||||
register_method("_commit", &GitAPI::_commit);
|
||||
register_method("_get_is_vcs_intialized", &GitAPI::_get_is_vcs_intialized);
|
||||
register_method("_is_vcs_initialized", &GitAPI::_is_vcs_initialized);
|
||||
register_method("_get_modified_files_data", &GitAPI::_get_modified_files_data);
|
||||
register_method("_get_file_diff", &GitAPI::_get_file_diff);
|
||||
register_method("_get_project_name", &GitAPI::_get_project_name);
|
||||
@@ -114,18 +114,18 @@ void GitAPI::create_gitignore_and_gitattributes() {
|
||||
"# Set the default behavior, in case people don't have core.autocrlf set.\n"
|
||||
"* text=auto\n\n"
|
||||
|
||||
"#Explicitly declare text files you want to always be normalized and converted\n"
|
||||
"#to native line endings on checkout.\n"
|
||||
"# Explicitly declare text files you want to always be normalized and converted\n"
|
||||
"# to native line endings on checkout.\n"
|
||||
"*.cpp text\n"
|
||||
"*.c text\n"
|
||||
"*.h text\n"
|
||||
"*.gd text\n"
|
||||
"*.cs text\n\n"
|
||||
|
||||
"#Declare files that will always have CRLF line endings on checkout.\n"
|
||||
"# Declare files that will always have CRLF line endings on checkout.\n"
|
||||
"*.sln text eol=crlf\n\n"
|
||||
|
||||
"#Denote all files that are truly binary and should not be modified.\n"
|
||||
"# Denote all files that are truly binary and should not be modified.\n"
|
||||
"*.png binary\n"
|
||||
"*.jpg binary\n");
|
||||
file->close();
|
||||
@@ -165,7 +165,7 @@ void GitAPI::create_initial_commit() {
|
||||
git_signature_free(sig);
|
||||
}
|
||||
|
||||
bool GitAPI::_get_is_vcs_intialized() {
|
||||
bool GitAPI::_is_vcs_initialized() {
|
||||
|
||||
return is_initialized;
|
||||
}
|
||||
@@ -175,7 +175,7 @@ Dictionary GitAPI::_get_modified_files_data() {
|
||||
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
|
||||
opts.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR;
|
||||
opts.flags = GIT_STATUS_OPT_EXCLUDE_SUBMODULES;
|
||||
opts.flags |= GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX | GIT_STATUS_OPT_SORT_CASE_SENSITIVELY;
|
||||
opts.flags |= GIT_STATUS_OPT_INCLUDE_UNTRACKED | GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX | GIT_STATUS_OPT_SORT_CASE_SENSITIVELY | GIT_STATUS_OPT_RECURSE_UNTRACKED_DIRS;
|
||||
|
||||
git_status_list *statuses = NULL;
|
||||
GIT2_CALL(git_status_list_new(&statuses, repo, &opts), "Could not get status information from repository", NULL);
|
||||
@@ -272,7 +272,7 @@ bool GitAPI::_initialize(const String p_project_root_path) {
|
||||
WARN_PRINT("Multiple libgit2 instances are running");
|
||||
}
|
||||
|
||||
if (is_initialized) {
|
||||
if (repo) {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,8 @@ class GitAPI : public EditorVCSInterface {
|
||||
|
||||
static GitAPI *singleton;
|
||||
|
||||
bool is_initialized;
|
||||
|
||||
Array staged_files;
|
||||
|
||||
PanelContainer *init_settings_panel_container;
|
||||
@@ -30,7 +32,7 @@ class GitAPI : public EditorVCSInterface {
|
||||
git_repository *repo;
|
||||
|
||||
void _commit(const String p_msg);
|
||||
bool _get_is_vcs_intialized();
|
||||
bool _is_vcs_initialized();
|
||||
Dictionary _get_modified_files_data();
|
||||
Array _get_file_diff(const String file_path);
|
||||
String _get_project_name();
|
||||
@@ -45,7 +47,6 @@ public:
|
||||
|
||||
static GitAPI *get_singleton() { return singleton; }
|
||||
|
||||
bool is_initialized;
|
||||
Array diff_contents;
|
||||
|
||||
void create_gitignore_and_gitattributes();
|
||||
|
||||
@@ -55,8 +55,8 @@ extern "C" int diff_line_callback_function(const git_diff_delta *delta, const gi
|
||||
result["line_count"] = line->num_lines;
|
||||
result["old_line_number"] = line->old_lineno;
|
||||
result["offset"] = line->content_offset;
|
||||
|
||||
|
||||
godot::GitAPI::get_singleton()->diff_contents.push_back(result);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user