When performing a clone there are two potential issues. The existing issue is that when a repository is created to clone into, it does not contain any data initially. This leaves other node operations thinking that a repository does exist but when they try to perform operations on it, those will fail. These will be surfaced as warnings but the node will continue to operate. The other issue, while writing fetch v2, is that if a clone fails, then cleanup needs to be performed -- to remove the empty repository from storage. To tackle both these issues, a temporary directory is used in the place of the repository. If a clone fails then the temporary directory is dropped and nothing needs to be done. If the clone succeeds then it can be safely moved to the storage. Signed-off-by: Fintan Halpenny <fintan.halpenny@gmail.com> X-Clacks-Overhead: GNU Terry Pratchett |
||
|---|---|---|
| .. | ||
| src | ||
| Cargo.toml | ||
| Dockerfile | ||