clone does not clean up on failure
See original GitHub issuePlease be sure to mention:
- whether you are using Node or the Browser: Node
- how you are using it (if you are using a bundler what bundler; if you are using a
<script>
tag what CDN URL): With TypeScript usingtsc
Hi everyone 👋
I’ve noticed that when clone fails due to an unreachable remote, a .git
directory is left behind in the chosen dir
.
Here is what I understand is the source of this problem:
In the clone
command, init()
is called to create and populate the local directory.
After this, the remote is added, fetched from and finally the default branch is checked out.
Any of these steps may fail, leaving us with a partially complete repository.
In the API for clone, there is an error handler, but it does not do any cleanup.
I feel there should be an error handler from here to here, which should remove the partial repository completely. After fetch has succeeded, it is very likely the repository is viable and does not need to be removed.
I believe binary git handles all error cases in clone by cleaning up partial state completely and I think it would be intuitive for isomorphic git to emulate this behavior.
Thank you for the great project, this is a minor inconvenience and I have otherwise thoroughly enjoyed using it so far!
Issue Analytics
- State:
- Created 3 years ago
- Comments:12 (12 by maintainers)
I’ve added another issue, let’s continue the discussion there.
🎉 This issue has been resolved in version 1.8.8 🎉
The release is available on:
Your semantic-release bot 📦🚀