]> source.dussan.org Git - jgit.git/commit
MergeCommand should create missing branches 41/2341/1
authorChristian Halstrick <christian.halstrick@sap.com>
Wed, 26 Jan 2011 15:30:13 +0000 (16:30 +0100)
committerChristian Halstrick <christian.halstrick@sap.com>
Wed, 26 Jan 2011 16:17:44 +0000 (17:17 +0100)
commit85f69c286b6c3225dcff05aba42910daefb28da0
treee6865f83af49781e62ad6d05a295f5d5947990aa
parent36e396f8b997d83480a392cc102d9dda38e24019
MergeCommand should create missing branches

If HEAD exists but points to an not-existing branch the merge
command should silently create the missing branch and check
it out. This happens if you pull into freshly initalized repo.
HEAD points to refs/heads/master but refs/heads/master doesn't
exist. If you know merge a commit X into HEAD then the branch
master should be created (pointing to X) the working tree should
be updated to reflect X. That is achieved by checkout with one
tree only (HEAD is missing).

A test for this functionality will come the the next proposal
in PullCommandTest.

Change-Id: Id4a0d56d944e0acebd4b3157428bb50bd3fdd872
Signed-off-by: Christian Halstrick <christian.halstrick@sap.com>
org.eclipse.jgit/src/org/eclipse/jgit/api/MergeCommand.java