]> source.dussan.org Git - jgit.git/commit
Support cherry-picking a root commit 07/201607/1
authorThomas Wolf <twolf@apache.org>
Sun, 23 Apr 2023 19:31:40 +0000 (21:31 +0200)
committerThomas Wolf <twolf@apache.org>
Sat, 29 Apr 2023 11:24:32 +0000 (13:24 +0200)
commit8bc13fb79d3ff44f09b67a1effda7155b47391ae
tree494e1ec52f21325470dfa8b71dc4a3cbe1c01f97
parent3ed4cdda6b99f812258ca50bd77447a28d9d4596
Support cherry-picking a root commit

Handle the case of the commit to be picked not having any parents.

Since JGit implements cherry-pick as a 3-way-merge between the commit
to be picked and the target commit, using the parent of the picked
commit as merge base, this is super simple: just don't set a base tree.
The merger will not find any merge base and will supply an empty tree
iterator for the base.

Bug: 581832
Change-Id: I88985f1b1723db5b35ce58bf228bc48d23d6fca3
Signed-off-by: Thomas Wolf <twolf@apache.org>
org.eclipse.jgit.test/tst/org/eclipse/jgit/api/CherryPickCommandTest.java
org.eclipse.jgit/src/org/eclipse/jgit/api/CherryPickCommand.java