From 7861036624b604bacb690a3d42afff1ee40fdca2 Mon Sep 17 00:00:00 2001 From: JustAnotherArchivist Date: Tue, 21 Mar 2023 19:44:20 +0000 Subject: [PATCH] Add submodule check #13 --- codearchiver/modules/git.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/codearchiver/modules/git.py b/codearchiver/modules/git.py index bb74df1..24e212e 100644 --- a/codearchiver/modules/git.py +++ b/codearchiver/modules/git.py @@ -154,6 +154,11 @@ class Git(codearchiver.core.Module): os.remove('tmp.pack') os.remove('tmp.idx') + _logger.info('Checking for submodules') + _, commitsWithSubmodules, _ = codearchiver.subprocess.run_with_log(['git', 'log', '--format=format:%H', '--diff-filter=d', '--all', '--', '.gitmodules'], cwd = directory) + if commitsWithSubmodules: + _logger.warning('Submodules found but extraction not supported') + _logger.info(f'Removing clone') shutil.rmtree(directory)