Commit 5be0a71
Fix git checkout error when switching to pr-screenshot branch
The script was failing with "Your local changes to the following files would be overwritten by checkout" because:
- Screenshot tests run with --update-goldens, which modifies files in test/screenshots/goldens/
- These files are then copied to a temp directory
- When attempting to checkout pr-screenshot branch, git refuses due to uncommitted local changes
Fixed by using `git checkout -f` (force) to discard local changes when switching branches. This is safe because:
- Screenshots are already copied to temp directory before checkout
- The modified golden files are test artifacts, not production code
- We want to switch to the clean pr-screenshot branch regardless of local changes
This allows the workflow to successfully commit screenshots to the pr-screenshot branch.
Co-authored-by: richardthe3rd <573334+richardthe3rd@users.noreply.github.com>1 parent 77ce2ae commit 5be0a71
1 file changed
Lines changed: 4 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
42 | 42 | | |
43 | 43 | | |
44 | 44 | | |
45 | | - | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
46 | 49 | | |
47 | 50 | | |
48 | 51 | | |
| |||
0 commit comments