[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?

http://egit.eclipse.org/w/?p=jgit.git;a=blob;f=org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CloneCommandTest.java;h=f21dc4a0be0680f105e84f168fdcc138997b0743;hb=HEAD


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
end


    command.call
  end

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