Skip to content

Commit 3a37fe7

Browse files
committed
fix: --reset-to delete file if not present in old commit
1 parent 03cce7c commit 3a37fe7

File tree

1 file changed

+6
-0
lines changed
  • packages/browseros/build/modules/apply

1 file changed

+6
-0
lines changed

packages/browseros/build/modules/apply/common.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -63,6 +63,12 @@ def apply_single_patch(
6363
if file_exists_in_commit(file_path, reset_to, chromium_src):
6464
log_info(f" Resetting to {reset_to[:8]}: {file_path}")
6565
reset_file_to_commit(file_path, reset_to, chromium_src)
66+
else:
67+
# File doesn't exist in target commit - delete it so patch can create fresh
68+
target_file = chromium_src / file_path
69+
if target_file.exists():
70+
log_info(f" Deleting (not in {reset_to[:8]}): {file_path}")
71+
target_file.unlink()
6672

6773
if dry_run:
6874
# Just check if patch would apply

0 commit comments

Comments
 (0)