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.
This commit is contained in:
Fries
2023-05-18 23:28:08 -07:00
parent 3c50df7af0
commit 4cb6ec0edd

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