[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] Migrating from Jgit 1.0 to 1.1

2011/9/28 Eduardo FalcÃo <edu.falcao@xxxxxxxxx>
Hi,

Finally I made it work.

Command line:
    Â$git brach newbranch -t origin/foo

Jgit 1.1 equivalent:
    CreateBranchCommand cbc = GetRepository().branchCreate();
    cbc.setName("newbranch");
    cbc.setStartPoint("origin/foo");
    cbc.setUpstreamMode(SetupUpstreamMode.TRACK);
    cbc.call();

----------------------------------------------------------------------------------------------------

But I think i found a bug in CheckoutCommand. That code:
    CheckoutCommand cc = GetRepository().checkout();
    cc.setName("newbranch");
    cc.setCreateBranch(true);
    cc.setUpstreamMode(SetupUpstreamMode.TRACK);
    cc.setStartPoint("origin/foo");
    cc.call();

This checkout create a new branch tracking a remote, but I opened my repo and typed:
$git config -l
There I could see that a reference from "newbranch" not exists toÂ"origin/foo"

could you file a bug for this problem atÂ
https://bugs.eclipse.org/bugs/enter_bug.cgi?product=JGitÂ?

--
Matthias