From eab6db9f27dc18865bfd290a68c4de0722a2633c Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Fri, 10 Mar 2023 01:18:41 +0000 Subject: [PATCH] Better storage metadata search now that the module name is recorded there anyway --- codearchiver/modules/git.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/codearchiver/modules/git.py b/codearchiver/modules/git.py index 19d7889..f7f704d 100644 --- a/codearchiver/modules/git.py +++ b/codearchiver/modules/git.py @@ -75,9 +75,7 @@ class Git(codearchiver.core.Module): oldCommits = {} # dict to keep the order reasonable basedOnBundles = {} # ditto if self._storage: - for oldBundle in self._storage.search_metadata([('Root commit', c) for c in rootCommits]): - if not oldBundle.startswith('git_'): #TODO Is there a more generic and elegant approach? - continue + for oldBundle in self._storage.search_metadata([('Module', type(self).name)] + [('Root commit', c) for c in rootCommits]): _logger.info(f'Previous bundle: {oldBundle!r}') with self._storage.open_metadata(oldBundle) as fp: idx = GitMetadata.deserialise(fp)