|
|
@ -122,9 +122,8 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> { |
|
|
|
if (headRef == null) |
|
|
|
if (headRef == null) |
|
|
|
throw new NoHeadException( |
|
|
|
throw new NoHeadException( |
|
|
|
JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported); |
|
|
|
JGitText.get().commitOnRepoWithoutHEADCurrentlyNotSupported); |
|
|
|
RevCommit headCommit = revWalk.parseCommit(headRef.getObjectId()); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
newHead = headCommit; |
|
|
|
newHead = revWalk.parseCommit(headRef.getObjectId()); |
|
|
|
|
|
|
|
|
|
|
|
// loop through all refs to be cherry-picked
|
|
|
|
// loop through all refs to be cherry-picked
|
|
|
|
for (Ref src : commits) { |
|
|
|
for (Ref src : commits) { |
|
|
@ -156,12 +155,12 @@ public class CherryPickCommand extends GitCommand<CherryPickResult> { |
|
|
|
merger.setBase(srcParent.getTree()); |
|
|
|
merger.setBase(srcParent.getTree()); |
|
|
|
merger.setCommitNames(new String[] { "BASE", ourName, |
|
|
|
merger.setCommitNames(new String[] { "BASE", ourName, |
|
|
|
cherryPickName }); |
|
|
|
cherryPickName }); |
|
|
|
if (merger.merge(headCommit, srcCommit)) { |
|
|
|
if (merger.merge(newHead, srcCommit)) { |
|
|
|
if (AnyObjectId.equals(headCommit.getTree().getId(), merger |
|
|
|
if (AnyObjectId.equals(newHead.getTree().getId(), merger |
|
|
|
.getResultTreeId())) |
|
|
|
.getResultTreeId())) |
|
|
|
continue; |
|
|
|
continue; |
|
|
|
DirCacheCheckout dco = new DirCacheCheckout(repo, |
|
|
|
DirCacheCheckout dco = new DirCacheCheckout(repo, |
|
|
|
headCommit.getTree(), repo.lockDirCache(), |
|
|
|
newHead.getTree(), repo.lockDirCache(), |
|
|
|
merger.getResultTreeId()); |
|
|
|
merger.getResultTreeId()); |
|
|
|
dco.setFailOnConflict(true); |
|
|
|
dco.setFailOnConflict(true); |
|
|
|
dco.checkout(); |
|
|
|
dco.checkout(); |
|
|
|