Skip to content

Commit c6f1bda

Browse files
committed
Ensure force checkout to clean up any leftovers from a previous state.
Closes #62
1 parent 1c2ca1f commit c6f1bda

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/main/java/org/springframework/data/release/git/GitOperations.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,7 +216,7 @@ public void checkout(TrainIteration iteration) {
216216
doWithGit(project, git -> {
217217

218218
logger.log(module, "git checkout %s", tag);
219-
git.checkout().setName(tag.toString()).call();
219+
git.checkout().setName(tag.toString()).setForced(true).call();
220220
});
221221
});
222222

@@ -788,7 +788,7 @@ private void checkout(Project project, Branch branch, BranchCheckoutMode mode) {
788788
doWithGit(project, git -> {
789789

790790
Optional<Ref> ref = Optional.ofNullable(git.getRepository().findRef(branch.toString()));
791-
CheckoutCommand checkout = git.checkout().setName(branch.toString());
791+
CheckoutCommand checkout = git.checkout().setName(branch.toString()).setForced(true);
792792

793793
if (ref.isPresent()) {
794794

0 commit comments

Comments
 (0)