# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


import io
import os
from .exceptions import GitCommandError



class GitRevisionReader(object):
    def __init__(self, folder, revision):
        self.folder = folder
        self.revision = revision
        super(GitRevisionReader, self).__init__()

    def get_file_contents(self, path):
        try:
            return self.folder.get_local_file_at_revision(
                path, self.revision, failure_ok=False
            )
        except GitCommandError:
            return ""


class WorkingCopyReader(object):
    def __init__(self, folder, path):

# Path: jirafs/exceptions.py
# class GitCommandError(JirafsError):
#     def __init__(self, *args, **kwargs):
#         self._command = kwargs.pop("cmd", None)
#         self._returncode = kwargs.pop("returncode", None)
#         self._output = kwargs.pop("stdout", None)
# 
#         super(GitCommandError, self).__init__(*args, **kwargs)
# 
#     @property
#     def command(self):
#         return self._command
# 
#     @property
#     def returncode(self):
#         return self._returncode
# 
#     @property
#     def output(self):
#         return self._output


# Path: jirafs/readers.py
import io
import os
from .exceptions import GitCommandError




class GitRevisionReader(object):
    def __init__(self, folder, revision):
        self.folder = folder
        self.revision = revision
        super(GitRevisionReader, self).__init__()

    def get_file_contents(self, path):
        try:
            return self.folder.get_local_file_at_revision(
                path, self.revision, failure_ok=False
            )
        except GitCommandError:
            return ""


class WorkingCopyReader(object):
    def __init__(self, folder, path):

        self.folder = folder