|
|
|
@ -8,15 +8,21 @@ from pathlib import Path
|
|
|
|
|
|
|
|
|
|
import contextlib
|
|
|
|
|
import os
|
|
|
|
|
import re
|
|
|
|
|
import subprocess
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# TODO config file (and defaults here)
|
|
|
|
|
IGNORES = [
|
|
|
|
|
r"\.sync",
|
|
|
|
|
r"\.git/modules", # XXX check this again
|
|
|
|
|
r"\.local/share/containers/storage",
|
|
|
|
|
]
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
def git_directories(startdir) -> Path:
|
|
|
|
|
for dirpath, dirnames, _ in os.walk(startdir):
|
|
|
|
|
if '.sync' in dirpath:
|
|
|
|
|
continue
|
|
|
|
|
if '.git/modules' in dirpath:
|
|
|
|
|
# FIXME
|
|
|
|
|
if any(re.search(ignore, dirpath) for ignore in IGNORES):
|
|
|
|
|
continue
|
|
|
|
|
if set(['info', 'objects', 'refs']).issubset(set(dirnames)):
|
|
|
|
|
yield Path(dirpath)
|
|
|
|
|