1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-03 00:52:12 +00:00

HackStudio: Use String instead of LexicalPath

LexicalPath is a 'heavier' object than a String that is mainly used for
path parsing and validation, we don't actually need any of that in
GitRepo and its related files, so let's move to String :^)

I've also done some east-const conversion in the files that I was
editing for the string change.
This commit is contained in:
Conor Byrne 2021-12-31 18:18:08 +00:00 committed by Andreas Kling
parent 4cfc992125
commit 14b2656107
11 changed files with 79 additions and 77 deletions

View file

@ -38,7 +38,7 @@ EditorWrapper::EditorWrapper()
set_current_editor_wrapper(this);
};
m_editor->on_open = [](String path) {
m_editor->on_open = [](String const& path) {
open_file(path);
};
@ -93,10 +93,10 @@ void EditorWrapper::save()
void EditorWrapper::update_diff()
{
if (m_git_repo)
m_hunks = Diff::parse_hunks(m_git_repo->unstaged_diff(LexicalPath(filename())).value());
m_hunks = Diff::parse_hunks(m_git_repo->unstaged_diff(filename()).value());
}
void EditorWrapper::set_project_root(LexicalPath const& project_root)
void EditorWrapper::set_project_root(String const& project_root)
{
m_project_root = project_root;
auto result = GitRepo::try_to_create(*m_project_root);