Skip to content

Commit cf9aec8

Browse files
committed
Commit the adding of the patches local module and the first patch file conversion together
This makes sense since a module with no build steps is not considered valid. Signed-off-by: jakub-nt <175944085+jakub-nt@users.noreply.github.com>
1 parent 2e21c63 commit cf9aec8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

cfbs/commands.py

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1418,15 +1418,24 @@ def cfbs_convert_git_commit(
14181418
if not patches_module_present:
14191419
print("Adding patches local module...")
14201420
mkdir(patches_dir)
1421-
add_command(
1421+
1422+
config = CFBSConfig.get_instance()
1423+
config.add_command(
14221424
[patches_module],
14231425
added_by="cfbs convert",
14241426
explicit_build_steps=["patch " + patch_filename],
14251427
)
14261428
# `explicit_build_steps=[]` would fail validation
1427-
# TODO: rewrite this to temporarily avoid validation to fix the poor Git history for the first file converted to a patch file
1429+
config.save()
1430+
1431+
try:
1432+
cfbs_convert_git_commit(
1433+
"Added patches local module, converted './%s' into a .patch file"
1434+
% modified_file
1435+
)
1436+
except:
1437+
log.warning("Git commit failed, continuing without committing...")
14281438

1429-
# no need to `cfbs_convert_git_commit` here, the `add_command` will Git commit the added patches local module
14301439
patches_module_present = True
14311440
else:
14321441
config = CFBSConfig.get_instance()

0 commit comments

Comments
 (0)