summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTwarit Waikar <wtwarit@gmail.com>2022-07-31 20:22:55 +0530
committerTwarit Waikar <wtwarit@gmail.com>2022-08-31 00:01:42 +0530
commitc698e4f5f93fc19af3c563b8ed4674d05e32303b (patch)
treeafa05153594ae8a5e6ab3f9ceed1f4c2610fc328
parentef9885f81a61e271aad06dd3f4eb5275cf71c53d (diff)
VCS: Fix empty metadata items being moved across stages
-rw-r--r--editor/plugins/version_control_editor_plugin.cpp9
1 files changed, 7 insertions, 2 deletions
diff --git a/editor/plugins/version_control_editor_plugin.cpp b/editor/plugins/version_control_editor_plugin.cpp
index 50d112ef9d..f579517ec8 100644
--- a/editor/plugins/version_control_editor_plugin.cpp
+++ b/editor/plugins/version_control_editor_plugin.cpp
@@ -553,10 +553,15 @@ void VersionControlEditorPlugin::_item_activated(Object *p_tree) {
void VersionControlEditorPlugin::_move_item(Tree *p_tree, TreeItem *p_item) {
CHECK_PLUGIN_INITIALIZED();
+ if (!p_item->has_meta(SNAME("file_path"))) {
+ // We only move items that are coming from files
+ return;
+ }
+
if (p_tree == staged_files) {
- EditorVCSInterface::get_singleton()->unstage_file(p_item->get_meta("file_path"));
+ EditorVCSInterface::get_singleton()->unstage_file(p_item->get_meta(SNAME("file_path")));
} else {
- EditorVCSInterface::get_singleton()->stage_file(p_item->get_meta("file_path"));
+ EditorVCSInterface::get_singleton()->stage_file(p_item->get_meta(SNAME("file_path")));
}
}