From 0d275c10874f01d344892839e2ff59b6845717bd Mon Sep 17 00:00:00 2001 From: Peter Kriens Date: Mon, 16 Jan 2023 18:06:45 +0100 Subject: [PATCH] Fix error in checkout in 6.4.0 In 6.4.0 when a template was retrieved from Github that had a branch or tag, a lot of conflicts were reported. With the default branch master, things worked well. The code cloned the repo in a temporary directory. The checkout was given the instruction to create a new branch `_tmp`. This seems superfluous so I changed it to the more common `setAllPaths(true)` which checks it out in the empty directory. This solved the problem in 6.4.0 and it worked fine in 7.0.0 Since the jgit/egit versions differed, I could not determine why there were conflicts so I feel slightly uneasy about this. However, logically this makes more sense than the original model to create a _tmp branch. So I suggest we cherry pick this on the next branch. --- Signed-off-by: Peter Kriens Signed-off-by: Peter Kriens --- .../src/org/bndtools/templating/jgit/GitCloneTemplate.java | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/org.bndtools.templating.gitrepo/src/org/bndtools/templating/jgit/GitCloneTemplate.java b/org.bndtools.templating.gitrepo/src/org/bndtools/templating/jgit/GitCloneTemplate.java index 467f648b8b..06da004407 100644 --- a/org.bndtools.templating.gitrepo/src/org/bndtools/templating/jgit/GitCloneTemplate.java +++ b/org.bndtools.templating.gitrepo/src/org/bndtools/templating/jgit/GitCloneTemplate.java @@ -117,8 +117,7 @@ public ResourceMap generateOutputs(Map> parameters, IProgre Git git = cloneCmd.call(); CheckoutCommand checkout = git.checkout() - .setCreateBranch(true) - .setName("_tmp"); + .setAllPaths(true); if (params.branch == null) { checkout.setStartPoint(GitCloneTemplateParams.DEFAULT_BRANCH);