Skip to content

Commit

Permalink
[fix] Fixed bug where committing one codebase could potentially erase…
Browse files Browse the repository at this point in the history
… all files of another codebase
  • Loading branch information
pajama-coder committed Nov 20, 2024
1 parent 4b0a334 commit 981fc29
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/codebase-store.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,9 @@ void CodebaseStore::generate_files(
const std::map<std::string, std::string> &files
) {
std::set<std::string> old_keys;
m_store->keys(KEY_file_tree(codebase_path), old_keys);
auto base_file_path = KEY_file_tree(codebase_path);
if (base_file_path.back() != '/') base_file_path += '/';
m_store->keys(base_file_path, old_keys);

for (const auto &i : files) {
auto &path = i.first;
Expand Down

0 comments on commit 981fc29

Please sign in to comment.