Commit 290efa7
committed
fix(import[provenance]) Guard against non-dict metadata in provenance stamping
why: If a config entry has metadata as a non-dict value (e.g. a string),
setdefault("metadata", {}) returns the existing non-dict value and the
subsequent dict key assignment raises TypeError.
what:
- Add isinstance guard before setdefault at both UPDATE_URL and
SKIP_UNCHANGED provenance-stamping call sites
- Add test_import_provenance_survives_non_dict_metadata verifying
non-dict metadata is replaced with a proper dict1 parent 1f00ace commit 290efa7
File tree
2 files changed
+54
-0
lines changed- src/vcspull/cli/import_cmd
- tests/cli
2 files changed
+54
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
952 | 952 | | |
953 | 953 | | |
954 | 954 | | |
| 955 | + | |
| 956 | + | |
955 | 957 | | |
956 | 958 | | |
957 | 959 | | |
| |||
963 | 965 | | |
964 | 966 | | |
965 | 967 | | |
| 968 | + | |
| 969 | + | |
966 | 970 | | |
967 | 971 | | |
968 | 972 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3547 | 3547 | | |
3548 | 3548 | | |
3549 | 3549 | | |
| 3550 | + | |
| 3551 | + | |
| 3552 | + | |
| 3553 | + | |
| 3554 | + | |
| 3555 | + | |
| 3556 | + | |
| 3557 | + | |
| 3558 | + | |
| 3559 | + | |
| 3560 | + | |
| 3561 | + | |
| 3562 | + | |
| 3563 | + | |
| 3564 | + | |
| 3565 | + | |
| 3566 | + | |
| 3567 | + | |
| 3568 | + | |
| 3569 | + | |
| 3570 | + | |
| 3571 | + | |
| 3572 | + | |
| 3573 | + | |
| 3574 | + | |
| 3575 | + | |
| 3576 | + | |
| 3577 | + | |
| 3578 | + | |
| 3579 | + | |
| 3580 | + | |
| 3581 | + | |
| 3582 | + | |
| 3583 | + | |
| 3584 | + | |
| 3585 | + | |
| 3586 | + | |
| 3587 | + | |
| 3588 | + | |
| 3589 | + | |
| 3590 | + | |
| 3591 | + | |
| 3592 | + | |
| 3593 | + | |
| 3594 | + | |
| 3595 | + | |
| 3596 | + | |
| 3597 | + | |
| 3598 | + | |
| 3599 | + | |
3550 | 3600 | | |
3551 | 3601 | | |
3552 | 3602 | | |
| |||
0 commit comments