5 Commits

Author SHA1 Message Date
Twarit
b20bde7d3e Update windows binaries for 3.2 beta 2 2019-11-25 01:13:01 +05:30
IronicallySerious
0e4f8acd3d Fix dirty read on initialiation status for the libgit2 instance 2019-11-25 00:44:12 +05:30
Twarit
531495001e Fix compat with fixed typo in function names 2019-11-24 23:04:47 +05:30
IronicallySerious
a21209bf62 Update linux binaries for #6 fix 2019-10-09 18:03:09 +05:30
Twarit
cd9239220a Enforce full file name status listings. Fix #6
libgit2 wasn't showing the full file names and showed just the
directory name in case there were many files being added at once
in a new directory.

Added a libgit2 flag that enforces full names on files
appearing in git status queries.
2019-10-09 17:07:01 +05:30
8 changed files with 18 additions and 17 deletions

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -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>

View File

@@ -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;
}

View File

@@ -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();

View File

@@ -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;
}