<commit_before>package com.github.cdcalc.strategy

import com.github.cdcalc.CalculateConfiguration
import com.github.cdcalc.Tag
import com.github.cdcalc.data.SemVer
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.Constants

/**
 * Limitations
 * - Tag and commit must match
 * - If not tag exists, we're doomed
 */
fun taggedCommit(): (Git, CalculateConfiguration) -> SemVer {
    return { git, branch ->
        val head = git.repository.resolve(Constants.HEAD)

        val single = git.tagList().call().map {
            val peel = git.repository.peel(it)
            if (peel.peeledObjectId != null) {
                Pair(peel.peeledObjectId, it.name)
            } else {
                Pair(it.objectId, it.name)
            }
        }.single { it.first.equals(head) }

        val tag = Tag(single.second)
        SemVer(tag.major, tag.minor, tag.patch)
    }
}<commit_msg>Mark unused variable<commit_after>package com.github.cdcalc.strategy

import com.github.cdcalc.CalculateConfiguration
import com.github.cdcalc.Tag
import com.github.cdcalc.data.SemVer
import org.eclipse.jgit.api.Git
import org.eclipse.jgit.lib.Constants

/**
 * Limitations
 * - Tag and commit must match
 * - If not tag exists, we're doomed
 */
fun taggedCommit(): (Git, CalculateConfiguration) -> SemVer {
    return { git, _ ->
        val head = git.repository.resolve(Constants.HEAD)

        val single = git.tagList().call().map {
            val peel = git.repository.peel(it)
            if (peel.peeledObjectId != null) {
                Pair(peel.peeledObjectId, it.name)
            } else {
                Pair(it.objectId, it.name)
            }
        }.single { it.first.equals(head) }

        val tag = Tag(single.second)
        SemVer(tag.major, tag.minor, tag.patch)
    }
}
{'fraction_non_alphanumeric': 0.12165178571428571, 'fraction_numerical': 0.0, 'mean_word_length': 2.376647834274953, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6960030', 'n_tokens_mistral': 577, 'n_tokens_neox': 543, 'n_words': 115}