git-remote-rclone icon indicating copy to clipboard operation
git-remote-rclone copied to clipboard

Crash when attempting to clone an existing remote repository

Open mosteo opened this issue 3 years ago • 1 comments

So, initialization, commiting, pushing, pulling, all work OK. Problem arises when I try to clone an existing remote in another location.

The steps to reproduce are:

- cd /tmp
- git init remote
- cd remote
- touch x
- git add x
- git commit -m init
- git remote add origin rclone://my/remote
- git push -u origin master
- cd ..
- rm -rf remote
- git clone rclone://my/remote

And the result of the last command is:

$ git clone rclone://my/remote
Cloning into 'remote'...
Traceback (most recent call last):
  File "/home/jano/bin/git-remote-rclone", line 408, in <module>
    main()
  File "/home/jano/bin/git-remote-rclone", line 404, in main
    rclone.communicate()
  File "/home/jano/bin/git-remote-rclone", line 380, in communicate
    self.import_refs_from_mirror(refs)
  File "/home/jano/bin/git-remote-rclone", line 186, in import_refs_from_mirror
    raise RuntimeError(
RuntimeError: rclone repository mirror not found
fatal: stream ends early
fast-import: dumping crash report to /tmp/remote/.git/fast_import_crash_2700224
fatal: error while running fast-import

Besides, the promised log at /tmp/remote/.git/fast_import_crash_2700224 does not exist, as the folder is not created yet it seems.

Any ideas on how to diagnose this further?

mosteo avatar Jun 13 '21 12:06 mosteo

I'm unable to reproduce this. Here is what I tried:

rclone delete dropbox:test
rm -fr /tmp/gcrtest
mkdir -p /tmp/gcrtest
cd /tmp/gcrtest
git init reporoot
cd reporoot
touch x
git add x
git commit -m init
git remote add origin rclone://dropbox/test
git push -u origin main
cd ..
rm -rf reporoot
git clone rclone://dropbox/test

Works exactly as expected.

redstreet avatar Aug 24 '23 08:08 redstreet