# Path: nbdiff/adapter/vcs_adapter.py
# class VcsAdapter(object):
# 
#     def get_modified_notebooks(self):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
#     def filter_modified_notebooks(self, file_hooks):
#         modified_notebooks = []
#         for item in file_hooks:
#             if re.search('.ipynb$', item[2]):
#                 modified_notebooks.append(item)
# 
#         return modified_notebooks
# 
#     def get_unmerged_notebooks(self):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
#     def filter_unmerged_notebooks(self, file_hooks):
#         unmerged_notebooks = []
#         for item in file_hooks:
#             if re.search('.ipynb$', item[3]):
#                 unmerged_notebooks.append(item)
# 
#         return unmerged_notebooks
# 
#     def stage_file(self, file, contents=None):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
# Path: nbdiff/adapter/vcs_adapter.py
# class NoVCSError(Exception):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return repr(self.value)


import sys
import subprocess
import os
from .vcs_adapter import VcsAdapter
from .vcs_adapter import NoVCSError
__author__ = 'root'



class GitAdapter(VcsAdapter):

    def __init__(self):
        is_git_repo = False

        try:
            is_git_repo = subprocess.check_output(
                "git rev-parse --is-inside-work-tree".split()) == "true\n"
        except subprocess.CalledProcessError:

# Path: nbdiff/adapter/vcs_adapter.py
# class VcsAdapter(object):
# 
#     def get_modified_notebooks(self):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
#     def filter_modified_notebooks(self, file_hooks):
#         modified_notebooks = []
#         for item in file_hooks:
#             if re.search('.ipynb$', item[2]):
#                 modified_notebooks.append(item)
# 
#         return modified_notebooks
# 
#     def get_unmerged_notebooks(self):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
#     def filter_unmerged_notebooks(self, file_hooks):
#         unmerged_notebooks = []
#         for item in file_hooks:
#             if re.search('.ipynb$', item[3]):
#                 unmerged_notebooks.append(item)
# 
#         return unmerged_notebooks
# 
#     def stage_file(self, file, contents=None):
#         raise NotImplementedError("Subclass must implement abstract method")
# 
# Path: nbdiff/adapter/vcs_adapter.py
# class NoVCSError(Exception):
#     def __init__(self, value):
#         self.value = value
# 
#     def __str__(self):
#         return repr(self.value)


# Path: nbdiff/adapter/git_adapter.py
import sys
import subprocess
import os
from .vcs_adapter import VcsAdapter
from .vcs_adapter import NoVCSError

__author__ = 'root'



class GitAdapter(VcsAdapter):

    def __init__(self):
        is_git_repo = False

        try:
            is_git_repo = subprocess.check_output(
                "git rev-parse --is-inside-work-tree".split()) == "true\n"
        except subprocess.CalledProcessError:

            raise NoVCSError("Git repository not found.")