mirror of
https://github.com/kp2pml30/git-third-party.git
synced 2026-02-16 23:54:41 +04:00
make shallow copy of submodules
This commit is contained in:
parent
1da50591dc
commit
cdd9e3e4fa
1 changed files with 4 additions and 4 deletions
|
|
@ -22,13 +22,13 @@ EXE_NAME = 'git third-party'
|
|||
import subprocess
|
||||
|
||||
try:
|
||||
top_dir = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True)
|
||||
top_dir_str = subprocess.check_output(['git', 'rev-parse', '--show-toplevel'], text=True)
|
||||
except:
|
||||
exit(1)
|
||||
|
||||
from pathlib import Path
|
||||
import os
|
||||
top_dir = Path(top_dir.strip())
|
||||
top_dir = Path(top_dir_str.strip())
|
||||
cur_dir = Path(os.getcwd())
|
||||
|
||||
config_path = top_dir.joinpath('.gitthirdparty')
|
||||
|
|
@ -66,8 +66,8 @@ def _update_at(name: str) -> None:
|
|||
if rs.returncode != 0:
|
||||
subprocess.run(['git', 'fetch', 'origin', '--depth=1', conf['commit']], check=True, cwd=target_dir)
|
||||
subprocess.run(['git', 'checkout', conf['commit']], check=True, cwd=target_dir)
|
||||
subprocess.run(['git', 'submodule', 'update', '--init', '--recursive'], check=True, cwd=target_dir)
|
||||
subprocess.run(['git', 'submodule', 'update', '--recursive'], check=True, cwd=target_dir)
|
||||
subprocess.run(['git', 'submodule', 'update', '--init', '--recursive', '--depth', '1'], check=True, cwd=target_dir)
|
||||
subprocess.run(['git', 'submodule', 'update', '--recursive', '--depth', '1'], check=True, cwd=target_dir)
|
||||
# apply patches
|
||||
patches_dir = _get_patches_dir(name)
|
||||
patch_files = [patches_dir.joinpath(str(i)) for i in range(1, conf['patches'] + 1)]
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue