<commit_before>﻿using System;
using System.IO;
using NuGit.Infrastructure;
using NuGit.Git;
using NuGit.Workspaces;

namespace NuGit.FileSystemWorkspaces
{

    /// <summary>
    /// A repository directory
    /// </summary>
    ///
    public class FileSystemRepository
        : IRepository
    {

        internal FileSystemRepository(FileSystemWorkspace workspace, GitRepositoryName name)
        {
            if (workspace == null) throw new ArgumentNullException("workspace");
            if (name == null) throw new ArgumentNullException("name");
            _workspace = workspace;
            Name = name;
            _rootPath = Path.Combine(workspace.RootPath, name);
        }


        readonly FileSystemWorkspace _workspace;


        readonly string _rootPath;


        /// <inheritdoc/>
        public IWorkspace Workspace
        {
            get { return _workspace; }
        }


        /// <inheritdoc/>
        public GitRepositoryName Name
        {
            get;
            private set;
        }


        /// <inheritdoc/>
        public void Checkout(GitCommitName commit)
        {
            // TODO If uncommitted changes, error
            if (ProcessExtensions.Invoke("git", "-C", _rootPath, "checkout", commit) != 0)
                throw new UserErrorException("git checkout failed");
        }


        /// <inheritdoc/>
        public DotNuGit GetDotNuGit()
        {
            string path = Path.Combine(_rootPath, ".nugit");
            if (!File.Exists(path)) return new DotNuGit();
            try
            {
                return DotNuGitParser.Parse(File.ReadLines(path));
            }
            catch (DotNuGitParseException e)
            {
                e.Path = path;
                throw;
            }
        }

    }

}
<commit_msg>FileSystemRepository: Expose RootPath<commit_after>﻿using System;
using System.IO;
using NuGit.Infrastructure;
using NuGit.Git;
using NuGit.Workspaces;

namespace NuGit.FileSystemWorkspaces
{

    /// <summary>
    /// A repository directory
    /// </summary>
    ///
    public class FileSystemRepository
        : IRepository
    {

        internal FileSystemRepository(FileSystemWorkspace workspace, GitRepositoryName name)
        {
            if (workspace == null) throw new ArgumentNullException("workspace");
            if (name == null) throw new ArgumentNullException("name");
            _workspace = workspace;
            Name = name;
            RootPath = Path.Combine(workspace.RootPath, name);
        }


        readonly FileSystemWorkspace _workspace;


        public string RootPath
        {
            get;
            private set;
        }


        /// <inheritdoc/>
        public IWorkspace Workspace
        {
            get { return _workspace; }
        }


        /// <inheritdoc/>
        public GitRepositoryName Name
        {
            get;
            private set;
        }


        /// <inheritdoc/>
        public void Checkout(GitCommitName commit)
        {
            // TODO If uncommitted changes, error
            if (ProcessExtensions.Invoke("git", "-C", RootPath, "checkout", commit) != 0)
                throw new UserErrorException("git checkout failed");
        }


        /// <inheritdoc/>
        public DotNuGit GetDotNuGit()
        {
            string path = Path.Combine(RootPath, ".nugit");
            if (!File.Exists(path)) return new DotNuGit();
            try
            {
                return DotNuGitParser.Parse(File.ReadLines(path));
            }
            catch (DotNuGitParseException e)
            {
                e.Path = path;
                throw;
            }
        }

    }

}

{'fraction_non_alphanumeric': 0.09159510798855061, 'fraction_numerical': 0.0005204267499349467, 'mean_word_length': 1.414572864321608, 'pattern_counts': {'":': 0, '<': 15, '<?xml version=': 0, '>': 15, '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': '3101402', 'n_tokens_mistral': 1066, 'n_tokens_neox': 951, 'n_words': 223}