Skip to content

Commit 4cb6ec0

Browse files
committed
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.
1 parent 3c50df7 commit 4cb6ec0

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

godot-git-plugin/src/git_plugin.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ godot::TypedArray<godot::Dictionary> GitPlugin::_get_modified_files_data() {
245245
}
246246

247247
if (entry->status & git_status_index) {
248-
if (entry->status == GIT_STATUS_INDEX_RENAMED) {
248+
if (entry->status & GIT_STATUS_INDEX_RENAMED) {
249249
godot::String old_path = entry->head_to_index->old_file.path;
250250
stats_files.push_back(create_status_file(old_path, map_changes.at(GIT_STATUS_INDEX_DELETED), TREE_AREA_STAGED));
251251
stats_files.push_back(create_status_file(path, map_changes.at(GIT_STATUS_INDEX_NEW), TREE_AREA_STAGED));

0 commit comments

Comments
 (0)