Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » EGit / JGit » Idiomatic way to check for bare repos while cloning
Idiomatic way to check for bare repos while cloning [message #1851470] Wed, 06 April 2022 11:05
Sahil Marwaha is currently offline Sahil MarwahaFriend
Messages: 1
Registered: April 2022
Junior Member
I am trying to clone a repository programmatically using JGIT as so
Git.cloneRepository().setNoCheckout(true).setURI(remoteUrl).setDirectory(clonePath.toFile()).setProgressMonitor(progressMonitor).setCredentialsProvider(credentialsProvider)

I want to be able to detect and handle bare repositories separately. How can I do this?

Right now, the way I am doing it is
if (e.cause is TransportException && e.cause.toString().contains("Remote branch 'HEAD' not found in upstream origin"))

Is there a better way?
Previous Topic:autogc
Next Topic:Idiomatic way of saving a file
Goto Forum:
  


Current Time: Tue Apr 23 12:10:25 GMT 2024

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

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

Back to the top