Skip to main content



      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 07:05
Eclipse UserFriend
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: Mon May 19 10:19:57 EDT 2025

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

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

Back to the top