diff options
Diffstat (limited to 'editor/editor_vcs_interface.cpp')
-rw-r--r-- | editor/editor_vcs_interface.cpp | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/editor/editor_vcs_interface.cpp b/editor/editor_vcs_interface.cpp index 0954779300..3f2012cc16 100644 --- a/editor/editor_vcs_interface.cpp +++ b/editor/editor_vcs_interface.cpp @@ -168,21 +168,19 @@ void EditorVCSInterface::set_singleton(EditorVCSInterface *p_singleton) { void EditorVCSInterface::create_vcs_metadata_files(VCSMetadata p_vcs_metadata_type, String &p_dir) { if (p_vcs_metadata_type == VCSMetadata::GIT) { - FileAccess *f = FileAccess::open(p_dir.plus_file(".gitignore"), FileAccess::WRITE); - if (!f) { + Ref<FileAccess> f = FileAccess::open(p_dir.plus_file(".gitignore"), FileAccess::WRITE); + if (f.is_null()) { ERR_FAIL_MSG(TTR("Couldn't create .gitignore in project path.")); } else { f->store_line("# Godot 4+ specific ignores"); f->store_line(".godot/"); - memdelete(f); } f = FileAccess::open(p_dir.plus_file(".gitattributes"), FileAccess::WRITE); - if (!f) { + if (f.is_null()) { ERR_FAIL_MSG(TTR("Couldn't create .gitattributes in project path.")); } else { f->store_line("# Normalize EOL for all files that Git considers text files."); f->store_line("* text=auto eol=lf"); - memdelete(f); } } } |