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)
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)
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)