Skip to content

Commit

Permalink
Fix error in checkout in 6.4.0
Browse files Browse the repository at this point in the history
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 <Peter.Kriens@aQute.biz>

Signed-off-by: Peter Kriens <Peter.Kriens@aQute.biz>
  • Loading branch information
pkriens committed Jan 16, 2023
1 parent 2ec7755 commit 0d275c1
Showing 1 changed file with 1 addition and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -117,8 +117,7 @@ public ResourceMap generateOutputs(Map<String, List<Object>> 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);
Expand Down

0 comments on commit 0d275c1

Please sign in to comment.