Exemple #1
0
  private void completeUndo(Git git) {
    try {
      if (isUndo(git)) {
        git.checkout().setName("master").call();
        git.merge()
            .setStrategy(MergeStrategy.THEIRS)
            .include(git.getRepository().resolve("undo"))
            .setCommit(true)
            .call();
        git.branchDelete().setBranchNames("undo").call();
      }
    } catch (RuntimeException ex) {

    } catch (CheckoutConflictException e) {
      throw new RuntimeException(e);
    } catch (RefAlreadyExistsException e) {
      throw new RuntimeException(e);
    } catch (IOException e) {
      throw new RuntimeException(e);
    } catch (InvalidRefNameException e) {
      throw new RuntimeException(e);
    } catch (RefNotFoundException e) {
      throw new RuntimeException(e);
    } catch (GitAPIException e) {
      throw new RuntimeException(e);
    }
  }
Exemple #2
0
  public void reset() {

    try {

      if (!git.status().call().isClean()) git.reset().setMode(ResetType.HARD).call();

      makeCheckout("master", false);
      git.branchDelete().setBranchNames(vmBranch).setForce(true).call();

    } catch (Exception e) {
      clean(e);
    }
  }