From 4cb6ec0edd23a0a9718eef11438b677d37cefe51 Mon Sep 17 00:00:00 2001 From: Fries Date: Thu, 18 May 2023 23:28:08 -0700 Subject: [PATCH] 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. --- godot-git-plugin/src/git_plugin.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/godot-git-plugin/src/git_plugin.cpp b/godot-git-plugin/src/git_plugin.cpp index e294890..16ea175 100644 --- a/godot-git-plugin/src/git_plugin.cpp +++ b/godot-git-plugin/src/git_plugin.cpp @@ -245,7 +245,7 @@ godot::TypedArray 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));