VCS: Improve VCS UI/UX by QoL changes

The editor will now use the project path i.e. the place where the root of
the repo is supposed to be according to the user. This project path is
also sent into the plugin and so out-of-directory asset folders can also be
maintained this way.
This commit is contained in:
Twarit Waikar 2022-08-10 03:26:19 +05:30
parent 1bb5e65798
commit a62b0ec904
7 changed files with 368 additions and 142 deletions

View file

@ -32,7 +32,7 @@
#include "editor_node.h"
#define UNIMPLEMENTED() ERR_PRINT(TTR("Unimplemented virtual function in EditorVCSInterface based node: ") + __func__)
#define UNIMPLEMENTED() ERR_PRINT(vformat("Unimplemented virtual function in EditorVCSInterface based plugin: %s", __func__))
EditorVCSInterface *EditorVCSInterface::singleton = nullptr;
@ -409,14 +409,14 @@ void EditorVCSInterface::create_vcs_metadata_files(VCSMetadata p_vcs_metadata_ty
if (p_vcs_metadata_type == VCSMetadata::GIT) {
Ref<FileAccess> f = FileAccess::open(p_dir.path_join(".gitignore"), FileAccess::WRITE);
if (f.is_null()) {
ERR_FAIL_MSG(TTR("Couldn't create .gitignore in project path."));
ERR_FAIL_MSG("Couldn't create .gitignore in project path.");
} else {
f->store_line("# Godot 4+ specific ignores");
f->store_line(".godot/");
}
f = FileAccess::open(p_dir.path_join(".gitattributes"), FileAccess::WRITE);
if (f.is_null()) {
ERR_FAIL_MSG(TTR("Couldn't create .gitattributes in project path."));
ERR_FAIL_MSG("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");