Beispiel #1
0
def _get_submodule(repo, commit, path):
    """Retrieve submodule URL and path."""
    submodule_blob = repo.get_blob_or_tree(commit, '.gitmodules')
    config = dulwich.config.ConfigFile.from_file(
        BytesIO(submodule_blob.as_raw_string()))
    key = (b'submodule', path)
    submodule_url = config.get(key, b'url')
    submodule_path = config.get(key, b'path')
    return (submodule_url, submodule_path)
Beispiel #2
0
def _get_submodule(repo, commit, path):
    """Retrieve submodule URL and path."""
    submodule_blob = repo.get_blob_or_tree(commit, '.gitmodules')
    config = dulwich.config.ConfigFile.from_file(
        BytesIO(submodule_blob.as_raw_string()))
    key = (b'submodule', path)
    submodule_url = config.get(key, b'url')
    submodule_path = config.get(key, b'path')
    return (submodule_url, submodule_path)
Beispiel #3
0
 def getConfigValue(self, key):
     """
     Get a value from the sprintly section of the git configuration
     """
     try:
         # Get the config of this git repository
         config = self._repo.get_config_stack()
     except AttributeError:
         # Get the global git config
         config = dulwich.config.StackedConfig(dulwich.config.StackedConfig.default_backends())
     return config.get('sprintly', key)
Beispiel #4
0
 def getConfigValue(self, key):
     """
     Get a value from the sprintly section of the git configuration
     """
     try:
         # Get the config of this git repository
         config = self._repo.get_config_stack()
     except AttributeError:
         # Get the global git config
         config = dulwich.config.StackedConfig(
             dulwich.config.StackedConfig.default_backends())
     return config.get('sprintly', key)