// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/model/GitCommit.java
// public interface GitCommit extends HasObjectId {
// 
//     @Nonnull
//     String getMessage();
// 
//     /**
//      * Gets a collection of all tags in the repository that point to this commit.
//      *
//      * @return a collection of {@link GitTag} objects (may be empty)
//      */
//     @Nonnull
//     Collection<? extends GitTag> getTags();
// 
//     /**
//      * Gets a list of the parent commits.
//      *
//      * <p>If a commit has more than one parent, the commit is a merge commit, and the second and any further
//      * parents refer to the merged branch(es).</p>
//      *
//      * @return the list of parent commits; may be empty
//      */
//     @Nonnull
//     List<? extends GitCommit> getParents();
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/model/GitTag.java
// public interface GitTag {
// 
//     @Nonnull
//     String getName();
// 
//     @Nonnull
//     GitCommit getTarget();
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/Lazy.java
// public class Lazy<T> implements Supplier<T> {
// 
//     private final Supplier<T> supplier;
//     private transient volatile boolean initialized = false;
//     private transient T value;
// 
// 
//     private Lazy(Supplier<T> supplier) {
//         this.supplier = supplier;
//     }
// 
// 
//     @Nonnull
//     public static <T> Lazy<T> of(Supplier<T> supplier) {
//         return new Lazy<>(supplier);
//     }
// 
// 
//     @Override
//     public T get() {
//         if (!initialized) {
//             synchronized (this) {
//                 if (!initialized) {
//                     T t = supplier.get();
//                     value = t;
//                     initialized = true;
//                     return t;
//                 }
//             }
//         }
//         return value;
//     }
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/io/IOFunction.java
// @FunctionalInterface
// public interface IOFunction<T, R> {
// 
//     R apply(T t) throws IOException;
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/io/IOUtils.java
// public final class IOUtils {
// 
//     private IOUtils() { }
// 
//     public static <T> T unchecked(IOCallable<T> callable) {
//         try {
//             return callable.call();
//         } catch (IOException ex) {
//             throw new RuntimeIOException(ex);
//         }
//     }
// 
//     public static void unchecked(IORunnable runnable) {
//         try {
//             runnable.run();
//         } catch (IOException ex) {
//             throw new RuntimeIOException(ex);
//         }
//     }
// }


import com.google.common.collect.Multimap;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.unbrokendome.gradle.plugins.gitversion.model.GitCommit;
import org.unbrokendome.gradle.plugins.gitversion.model.GitTag;
import org.unbrokendome.gradle.plugins.gitversion.util.Lazy;
import org.unbrokendome.gradle.plugins.gitversion.util.io.IOFunction;
import org.unbrokendome.gradle.plugins.gitversion.util.io.IOUtils;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;
    @Override
    public String getId() {
        return objectId.name();
    }


    @Nonnull
    @Override
    public String getMessage() {
        return commitMessage.get();
    }


    private String readCommitMessage() {
        return withRevCommit(RevCommit::getFullMessage);
    }


    private <T> T withRevCommit(IOFunction<RevCommit, T> function) {
        return IOUtils.unchecked(() -> {
            try (RevWalk revWalk = new RevWalk(repository.getRepository())) {
                RevCommit commit = revWalk.parseCommit(objectId);
                return function.apply(commit);
            }
        });
    }


    @Nonnull
    @Override
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/model/GitCommit.java
// public interface GitCommit extends HasObjectId {
// 
//     @Nonnull
//     String getMessage();
// 
//     /**
//      * Gets a collection of all tags in the repository that point to this commit.
//      *
//      * @return a collection of {@link GitTag} objects (may be empty)
//      */
//     @Nonnull
//     Collection<? extends GitTag> getTags();
// 
//     /**
//      * Gets a list of the parent commits.
//      *
//      * <p>If a commit has more than one parent, the commit is a merge commit, and the second and any further
//      * parents refer to the merged branch(es).</p>
//      *
//      * @return the list of parent commits; may be empty
//      */
//     @Nonnull
//     List<? extends GitCommit> getParents();
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/model/GitTag.java
// public interface GitTag {
// 
//     @Nonnull
//     String getName();
// 
//     @Nonnull
//     GitCommit getTarget();
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/Lazy.java
// public class Lazy<T> implements Supplier<T> {
// 
//     private final Supplier<T> supplier;
//     private transient volatile boolean initialized = false;
//     private transient T value;
// 
// 
//     private Lazy(Supplier<T> supplier) {
//         this.supplier = supplier;
//     }
// 
// 
//     @Nonnull
//     public static <T> Lazy<T> of(Supplier<T> supplier) {
//         return new Lazy<>(supplier);
//     }
// 
// 
//     @Override
//     public T get() {
//         if (!initialized) {
//             synchronized (this) {
//                 if (!initialized) {
//                     T t = supplier.get();
//                     value = t;
//                     initialized = true;
//                     return t;
//                 }
//             }
//         }
//         return value;
//     }
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/io/IOFunction.java
// @FunctionalInterface
// public interface IOFunction<T, R> {
// 
//     R apply(T t) throws IOException;
// }
// 
// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/util/io/IOUtils.java
// public final class IOUtils {
// 
//     private IOUtils() { }
// 
//     public static <T> T unchecked(IOCallable<T> callable) {
//         try {
//             return callable.call();
//         } catch (IOException ex) {
//             throw new RuntimeIOException(ex);
//         }
//     }
// 
//     public static void unchecked(IORunnable runnable) {
//         try {
//             runnable.run();
//         } catch (IOException ex) {
//             throw new RuntimeIOException(ex);
//         }
//     }
// }


// Path: src/main/java/org/unbrokendome/gradle/plugins/gitversion/model/jgit/JGitCommit.java
import com.google.common.collect.Multimap;
import org.eclipse.jgit.lib.ObjectId;
import org.eclipse.jgit.revwalk.RevCommit;
import org.eclipse.jgit.revwalk.RevWalk;
import org.unbrokendome.gradle.plugins.gitversion.model.GitCommit;
import org.unbrokendome.gradle.plugins.gitversion.model.GitTag;
import org.unbrokendome.gradle.plugins.gitversion.util.Lazy;
import org.unbrokendome.gradle.plugins.gitversion.util.io.IOFunction;
import org.unbrokendome.gradle.plugins.gitversion.util.io.IOUtils;
import javax.annotation.Nonnull;
import java.util.Arrays;
import java.util.Collection;
import java.util.List;
import java.util.Objects;
import java.util.function.Supplier;
import java.util.stream.Collectors;
import java.util.stream.Stream;

    @Override
    public String getId() {
        return objectId.name();
    }


    @Nonnull
    @Override
    public String getMessage() {
        return commitMessage.get();
    }


    private String readCommitMessage() {
        return withRevCommit(RevCommit::getFullMessage);
    }


    private <T> T withRevCommit(IOFunction<RevCommit, T> function) {
        return IOUtils.unchecked(() -> {
            try (RevWalk revWalk = new RevWalk(repository.getRepository())) {
                RevCommit commit = revWalk.parseCommit(objectId);
                return function.apply(commit);
            }
        });
    }


    @Nonnull
    @Override
    public Collection<? extends GitTag> getTags() {