question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

clone does not clean up on failure

See original GitHub issue

Please 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 using tsc

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:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

2reactions
jcubiccommented, Jun 30, 2021

I’ve added another issue, let’s continue the discussion there.

2reactions
isomorphic-git-botcommented, Jun 30, 2021

🎉 This issue has been resolved in version 1.8.8 🎉

The release is available on:

Your semantic-release bot 📦🚀

Read more comments on GitHub >

github_iconTop Results From Across the Web

SCO doesn't clean up database clones created for cataloging ...
This leaves the cloned volume (and contained LUNs) behind unmapped, since they are not cleaned up in the failed cataloging process.
Read more >
Why does a clean git clone fix a failing build? - Stack Overflow
After running the build, it errors. When I do a clean git clone and check out the new branch, it works. What gives?...
Read more >
[5 Proven Ways] to Fix Macrium Reflect Clone Failed Error
Fix 2: Clean destination disk via clean command · 1. In the command prompt window, type “diskpart”. · 2. Type “list disk” to...
Read more >
clean up of a failed pdb clone? - Oracle Communities
I was attempting to clone a remote non-cdb to a pdb. unfortunately, I did not set the DB_CREATE_FILE_DEST so I believe I filled...
Read more >
CleanupScripts : clone cleanup scripts are not getting executed.
Clone cleanup scripts are not getting executed. Steps to Reproduce Clear and concise steps to reproduce the PRB : 1. Perform a clone....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found