Skip to content

Commit

Permalink
[fix] Dead-lock in updating of a builtin codebase
Browse files Browse the repository at this point in the history
  • Loading branch information
pajama-coder committed Aug 13, 2024
1 parent adbcaf0 commit ef365e9
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/codebase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,6 @@ class CodebaseFromRoot : public Codebase {
CodebaseFromRoot(Codebase *root);
~CodebaseFromRoot();


virtual auto version() const -> const std::string& override { return m_root->version(); }
virtual bool writable() const override { return m_root->writable(); }
virtual auto entry() const -> const std::string& override { return m_root->entry(); }
Expand Down Expand Up @@ -576,7 +575,7 @@ auto CodebaseFromStore::watch(const std::string &path, const std::function<void(

void CodebaseFromStore::sync(bool force, const std::function<void(bool)> &on_update) {
if (force) {
on_update(true);
Net::current().post([=]() { on_update(true); });
}
}

Expand Down Expand Up @@ -1060,7 +1059,7 @@ Codebase* Codebase::from_http(const std::string &url, const Fetch::Options &opti

auto Codebase::normalize_path(const std::string &path) -> std::string {
std::string k = path;
if (k.front() != '/') {
if (k.empty() || k.front() != '/') {
return utils::path_normalize('/' + k);
} else {
return utils::path_normalize(k);
Expand Down

0 comments on commit ef365e9

Please sign in to comment.