From 26f5fefac6f15db1c8c81fb78a919d35211695c4 Mon Sep 17 00:00:00 2001 From: jaseg Date: Sun, 20 Dec 2020 16:03:49 +0100 Subject: Update submodule config --- submodule-cache.py | 15 --------------- 1 file changed, 15 deletions(-) (limited to 'submodule-cache.py') diff --git a/submodule-cache.py b/submodule-cache.py index 5a0b9b9..b1b2c18 100644 --- a/submodule-cache.py +++ b/submodule-cache.py @@ -58,16 +58,6 @@ def get_global_cachedir(create=False, verbose=False): os.makedirs(le_path, exist_ok=True) return le_path -def splitdir_run(repo, spec): - source_branch, target_branch, prefix = spec.split(':') - with tempfile.TemporaryDirectory(prefix='sm-split-') as tmpdir: - try: - # --force to prevent errors for existing checkouts - subprocess.run('git worktree add --force'.split() + [tmpdir, source_branch], check=True, cwd=repo) - subprocess.run('git subtree split'.split() + ['-b', target_branch, '--prefix', prefix], check=True, cwd=tmpdir) - finally: - subprocess.run('git worktree remove'.split() + [tmpdir], check=True, cwd=repo) - if __name__ == '__main__': import argparse parser = argparse.ArgumentParser() @@ -83,8 +73,6 @@ if __name__ == '__main__': for cfg_id, (url, le_path) in list_submodules().items(): short_id = cfg_id.split('/')[-1] refdir = path.join(cachedir, short_id) - branch = get_submodule_prop(cfg_id, 'branch') - splitdir = get_submodule_prop(cfg_id, 'splitdir') if not path.isdir(refdir): print(f'Submodule {short_id} is not cached. Cloning from {url}...') subprocess.run('git clone --bare'.split() + quiet_opts + [url, refdir], check=True) @@ -100,9 +88,6 @@ if __name__ == '__main__': subprocess.run('git fetch'.split() + force_opts, cwd=refdir, check=True) - if splitdir: - splitdir_run(refdir, splitdir) - print(f'Checking out submodule {short_id}...') subprocess.run('git submodule update --init --reference'.split() + [refdir, le_path]) -- cgit