dolt clone
allows cloning a repo with a journal, but only if that repo is in a child directory.
#8791
Labels
dolt clone
allows cloning a repo with a journal, but only if that repo is in a child directory.
#8791
Ordinarily, you can't use
git clone
to make a copy of a local repo. This is becausegit clone
expects a remote (even if it's a "local" remote with the file:// protocol), and remotes and repos have a different structure: for instance, repos contain a journal and remotes don't.Thus, the following fails:
This will result in the error
However, this safeguard fails if the repo being cloned is a child of the current working directory. In this case, Dolt on startup loads the repo's oldgen as a
datas.database
and caches it. When the clone command executes, it sees that the databse has already been loaded and skips the chuck journal check.As a result, the clone operation completes... but only the oldgen is copied into the new repo. Any changes not in the oldgen (such as changes in the journal) don't get copied to the new repo.
Output:
No tables in working set
This is likely incorrect. The output of
dolt clone
probably shouldn't depend on the current working directory.My PR to defer DB loading (#8783) should fix this issue, but it breaks a test in
replication.bats
, "local clone", that appears to be depending on this behavior. Before I modify the test, I want to verify that the correct behavior here is to forbid cloning from another repo in this way.The text was updated successfully, but these errors were encountered: