All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.beijunyi.parallelgit.utils.exceptions.RefUpdateValidator Maven / Gradle / Ivy

There is a newer version: 2.0.0
Show newest version
package com.beijunyi.parallelgit.utils.exceptions;

import javax.annotation.Nonnull;

import org.eclipse.jgit.lib.RefUpdate;

public final class RefUpdateValidator {

  public static void validate(@Nonnull RefUpdate.Result result) {
    switch(result) {
      case REJECTED_CURRENT_BRANCH:
        throw new RefUpdateRejectedCurrentBranchException(result.name());
      case REJECTED:
        throw new RefUpdateRejectedException(result.name());
      case LOCK_FAILURE:
        throw new RefUpdateLockFailureException(result.name());
      case IO_FAILURE:
        throw new RefUpdateIOFailureException(result.name());
    }
  }

}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy