Skip to content

Commit 244ac94

Browse files
committed
extract_utils: use null work-tree for getting the list of affected files
`git apply --numstat` returns different paths depending on current working directory: $ pwd /home/luk/lineage-22/device/google/bramble $ git apply --numstat /home/luk/lineage-22/device/google/bramble/bramble/HbmSVManager.patch 46 2 smali/com/android/hbmsvmanager/filter/AmbientFilterFactory.smali $ pwd /home/luk/lineage-22/device/google/bramble/bramble $ git apply --numstat /home/luk/lineage-22/device/google/bramble/bramble/HbmSVManager.patch 46 2 bramble/smali/com/android/hbmsvmanager/filter/AmbientFilterFactory.smali And because of that __get_apktool_unpack_args() fails due to expecting path to start with res/, smali/ or be equal to AndroidManifest.xml. Change-Id: I947c115d61207d7be8280939d8266adda9f49a16
1 parent 1e37b8b commit 244ac94

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

extract_utils/fixups_blob.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -192,7 +192,9 @@ def __get_patches(self, ctx: BlobFixupCtx, module_patches_path: str):
192192
return patches
193193

194194
def __get_patch_affected_files(self, patch: str) -> List[str]:
195-
output = run_cmd(['git', 'apply', '--numstat', patch])
195+
output = run_cmd(
196+
['git', '--work-tree', os.devnull, 'apply', '--numstat', patch]
197+
)
196198

197199
files = []
198200
for line in output.strip().splitlines():

0 commit comments

Comments
 (0)