<commit_before>///////////////////////////////////////////////////////////////////////////////
// BUILD PROVIDER
///////////////////////////////////////////////////////////////////////////////

public class LocalBuildTagInfo : ITagInfo
{
    public LocalBuildTagInfo(bool isTag, string name)
    {
        IsTag = isTag;
        Name = name;
    }

    public LocalBuildTagInfo(ICakeContext context)
    {
        // Test to see if current commit is a tag...
        context.Information("Testing to see if current commit contains a tag...");
        IEnumerable<string> redirectedStandardOutput;
        IEnumerable<string> redirectedError;

        var exitCode = context.StartProcess(
            "git",
            new ProcessSettings {
                Arguments = "tag -l --points-at HEAD",
                RedirectStandardOutput = true,
                RedirectStandardError = true
            },
            out redirectedStandardOutput,
            out redirectedError
        );

        if (exitCode == 0)
        {
            var lines = redirectedStandardOutput.ToList();
            if (lines.Any())
            {
                IsTag = true;
                Name = lines.FirstOrDefault();
                context.Information("Tag name is {0}", Name);
            }
            else
            {
                context.Information("No tag is present.");
            }
        }
    }

    public bool IsTag { get; }

    public string Name { get; }
}

public class LocalBuildRepositoryInfo : IRepositoryInfo
{
    public LocalBuildRepositoryInfo(ICakeContext context)
    {
        try
        {
            context.Information("Testing to see if valid git repository...");
            var rootPath = BuildParameters.RootDirectoryPath;
            rootPath = context.GitFindRootFromPath(rootPath);<commit_msg>(build) Fix null reference exception<commit_after>///////////////////////////////////////////////////////////////////////////////
// BUILD PROVIDER
///////////////////////////////////////////////////////////////////////////////

public class LocalBuildTagInfo : ITagInfo
{
    public LocalBuildTagInfo(bool isTag, string name)
    {
        IsTag = isTag;
        Name = name;
    }

    public LocalBuildTagInfo(ICakeContext context)
    {
        // Test to see if current commit is a tag...
        context.Information("Testing to see if current commit contains a tag...");
        IEnumerable<string> redirectedStandardOutput;
        IEnumerable<string> redirectedError;

        var exitCode = context.StartProcess(
            "git",
            new ProcessSettings {
                Arguments = "tag -l --points-at HEAD",
                RedirectStandardOutput = true,
                RedirectStandardError = true
            },
            out redirectedStandardOutput,
            out redirectedError
        );

        if (exitCode == 0)
        {
            var lines = redirectedStandardOutput.ToList();
            if (lines.Any())
            {
                IsTag = true;
                Name = lines.FirstOrDefault();
                context.Information("Tag name is {0}", Name);
            }
            else
            {
                context.Information("No tag is present.");
            }
        }
    }

    public bool IsTag { get; }

    public string Name { get; }
}

public class LocalBuildRepositoryInfo : IRepositoryInfo
{
    public LocalBuildRepositoryInfo(ICakeContext context)
    {
        try
        {
            context.Information("Testing to see if valid git repository...");

            // Normally, would use BuildParameters.RootDirectoryPath here, but since
            // BuildProvider is executed before the Setup Task has executed, this property
            // is null.  Default to the current working directory for this test.
            var rootPath = context.GitFindRootFromPath(context.MakeAbsolute(context.Environment.WorkingDirectory));
{'fraction_non_alphanumeric': 0.15396380321182768, 'fraction_numerical': 0.0010196278358399185, 'mean_word_length': 1.4147692307692308, 'pattern_counts': {'":': 0, '<': 7, '<?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': '3379641', 'n_tokens_mistral': 896, 'n_tokens_neox': 856, 'n_words': 250}