remove numbers from patches themselves

This commit is contained in:
kp2pml30 2024-08-21 11:33:39 +04:00
parent 47f7d1aec5
commit fed4821da3

View file

@ -126,7 +126,7 @@ def save(args: list[str]) -> None:
patches_dir.joinpath(str(i)).unlink()
patches_dir.mkdir(parents=True, exist_ok=True)
target_dir = top_dir.joinpath(*name.split('/'))
subprocess.run(['git', 'format-patch', f'{conf["commit"]}..HEAD', '--numbered-files', '-o', patches_dir], check=True, cwd=target_dir)
subprocess.run(['git', 'format-patch', f'{conf["commit"]}..HEAD', '--no-numbered', '--numbered-files', '-o', patches_dir], check=True, cwd=target_dir)
new_patches = subprocess.run(['git', 'rev-list', '--count', f'{conf["commit"]}..HEAD'], check=True, cwd=target_dir, text=True, capture_output=True)
conf['patches'] = int(new_patches.stdout.strip())