<commit_before>﻿using System.IO;
using IOPath = System.IO.Path;
using MacroGuards;
using MacroGit;


namespace
produce
{


/// <summary>
/// A Produce repository
/// </summary>
///
public class
ProduceRepository
    : GitRepository
{


public
ProduceRepository(ProduceWorkspace workspace, GitRepositoryName name)
    : base(
        IOPath.Combine(
            Guard.NotNull(workspace, nameof(workspace)).Path,
            Guard.NotNull(name, nameof(name))))
{
    Workspace = workspace;
    DotProducePath = IOPath.Combine(Path, ".produce");
}


/// <summary>
/// Workspace the repository is in
/// </summary>
///
public ProduceWorkspace
Workspace
{
    get;
}


/// <summary>
/// Full path to the repository's .produce configuration file
/// </summary>
///
public string
DotProducePath
{
    get;
}


/// <summary>
/// Prepare a work directory with the specified name for this repository
/// </summary>
///
public string
GetWorkDirectory(string name)
{
    Guard.Required(name, nameof(name));

    var repositoryDir = IOPath.Combine(Workspace.GetProduceDirectory(), Name);
    if (!Directory.Exists(repositoryDir)) Directory.CreateDirectory(repositoryDir);

    var workDir = IOPath.Combine(repositoryDir, name);
    if (!Directory.Exists(workDir)) Directory.CreateDirectory(workDir);
    
    return workDir;
}


}
}<commit_msg>ProduceRepository: Don't auto-create dir in GetWorkDirectory()<commit_after>﻿using System.IO;
using IOPath = System.IO.Path;
using MacroGuards;
using MacroGit;


namespace
produce
{


/// <summary>
/// A Produce repository
/// </summary>
///
public class
ProduceRepository
    : GitRepository
{


public
ProduceRepository(ProduceWorkspace workspace, GitRepositoryName name)
    : base(
        IOPath.Combine(
            Guard.NotNull(workspace, nameof(workspace)).Path,
            Guard.NotNull(name, nameof(name))))
{
    Workspace = workspace;
    DotProducePath = IOPath.Combine(Path, ".produce");
}


/// <summary>
/// Workspace the repository is in
/// </summary>
///
public ProduceWorkspace
Workspace
{
    get;
}


/// <summary>
/// Full path to the repository's .produce configuration file
/// </summary>
///
public string
DotProducePath
{
    get;
}


/// <summary>
/// Get path to a work directory with the specified name for this repository
/// </summary>
///
/// <remarks>
/// The directory may or may not exist yet
/// </remarks>
///
public string
GetWorkDirectory(string name)
{
    Guard.Required(name, nameof(name));
    return IOPath.Combine(Workspace.GetProduceDirectory(), Name, name);
}


}
}
{'fraction_non_alphanumeric': 0.13629222309505107, 'fraction_numerical': 0.0, 'mean_word_length': 3.273489932885906, 'pattern_counts': {'":': 0, '<': 21, '<?xml version=': 0, '>': 21, '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': '7031125', 'n_tokens_mistral': 783, 'n_tokens_neox': 781, 'n_words': 197}