[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] ColneCommand won't clone all branches

On 5/5/11 7:29 PM, Chris Aniszczyk wrote:
On Wed, May 4, 2011 at 2:58 PM, Akos Tajti<akos.tajti@xxxxxxxxx> wrote:
The source repository (in src.getPath() directory) has two branches: master
and branch_a. The above code executes without exception, but the cloned
repository contains only branch_a. Is there a bug here or I miss something?

It should work, can you write a test that causes your scenario to fail in CloneCommandTest?


I can confirm that this does not work on master. There are no usages of CloneCommand#setCloneAllBranches and that the method is practically a no-op and the javadoc is lying :)

"git branch -a" using c-git tells me that the only local branch is master.

I looked around a bit using the diff tool and the only difference is the lack of "packed-refs" file in the repo cloned by jgit.

Here's how I'm using CloneCommand if it is of any help (warning: ruby code ahead :)

def clone(url)
command = CloneCommand.new.tap do |c|
# c is an instance of CloneCommand
c.set_uri url
c.set_bare true
c.set_directory java.io.File.new(File.join(REPO_ROOT, repo_path(url)))
c.set_clone_all_branches true


http://ketan.padegaonkar.name | http://eclipse.org/swtbot