Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Silent error when cloning repo(Failure to completely clone repo, but no errors reported)
Silent error when cloning repo [message #1835828] Mon, 14 December 2020 13:30 Go to next message
John Tipper is currently offline John TipperFriend
Messages: 2
Registered: April 2019
Junior Member
I am trying to clone a repo from GitHub using JGit, then check whether the clone worked successfully:

Path pathToRepo = ...

Git git = Git.cloneRepository()
             .setURI("https://github.com/owner/repo.git")
             .setDirectory(pathToRepo.toFile())
             .setCredentialsProvider(new UsernamePasswordCredentialsProvider("user", "token")
             .call();

System.out.println("is git: " + RepositoryCache.FileKey.isGitRepository(pathToRepo.toFile(), FS.DETECTED));


There are no errors logged, but I get "is git: false" in the output. When I go to pathToRepo in a shell, I can see a single file:

.git/objects/pack/pack-136db98fb0e2758151fd49441f989c1577b484d9.pack.

That file is large (~280MB) but there is nothing else under pathToRepo.

When I cd to pathToRepo and run "git status", I get "fatal: not a git repository".

I can successfully clone the repo from the command line using the https URL and the associated token and get a fully populated git checkout. Something is causing the clone to fail silently. Any ideas on what is going wrong here please?
Re: Silent error when cloning repo [message #1835830 is a reply to message #1835828] Mon, 14 December 2020 13:58 Go to previous messageGo to next message
Christian Halstrick is currently offline Christian HalstrickFriend
Messages: 274
Registered: July 2009
Senior Member
You could try to set a ProgressMonitor to see what is happening. Like in:

  Git.cloneRepository()
             .setURI("https://github.com/owner/repo.git")
             .setDirectory(pathToRepo.toFile())
             .setCredentialsProvider(new UsernamePasswordCredentialsProvider("user", "token")

             .setProgressMonitor(new TextProgressMonitor())

             .call();


Ciao
Chris
Re: Silent error when cloning repo [message #1835831 is a reply to message #1835828] Mon, 14 December 2020 14:03 Go to previous message
Thomas Wolf is currently offline Thomas WolfFriend
Messages: 576
Registered: August 2016
Senior Member
No idea. Which JGit version? Is the Github repo publicly accessible?
Previous Topic:JGit Clone Question
Next Topic:"Replace with HEAD revision" does not work during interactive rebase
Goto Forum:
  


Current Time: Thu Apr 25 00:56:22 GMT 2024

Powered by FUDForum. Page generated in 0.03441 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top