Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [jgit-dev] CommitBuilder Question

On Thu, Jun 23, 2011 at 13:10, Abhishek Bhatnagar <abhatnag@xxxxxxxxxx> wrote:
> I can't get CommitBuilder to work as advertised. To start with, I created a
> CommitBuilderTest [1].
> The use case is:
>
> 1.A commit already exists in the git repo
> 2. Create another commit using CommitBuilder Any help is appreciated it.
> Feel free to work in the gist itself. You could export it to
> org.eclipse.jgit.test/tst/org/eclipse/jgit/lib/CommitBuilderTests.java if
> you want to run it in the proper environment. Thanks Abhishek Bhatnagar
>
> ---------------------------------------------------------------------------------
> 1. Available in a gist here: https://gist.github.com/1043503

I am unclear about what you are trying to accomplish.

The code seems OK to me (I only read it, I didn't run it). It produces
a commit that is not attached to any branch.

If you wanted to update a branch, you should use the CommitCommand
available from a Git object's commit() method. Or start digging into
the low level UpdateRef stuff yourself. CommitBuilder is a low-level
object, not a higher level API object.

-- 
Shawn.


Back to the top