# Apply the patch
git apply golden.patch
error: No valid patches in input (allow with "--allow-empty")
# After saving the patch with encoding utf-8:
git apply diff.patch
diff.patch:7: trailing whitespace.
"""BLE provisioning helpers for Shelly integration."""
diff.patch:8: trailing whitespace.
diff.patch:9: trailing whitespace.
from __future__ import annotations
diff.patch:10: trailing whitespace.
diff.patch:11: trailing whitespace.
import asyncio
error: patch failed: homeassistant/components/shelly/config_flow.py:2
error: homeassistant/components/shelly/config_flow.py: patch does not apply
error: patch failed: homeassistant/components/shelly/const.py:36
error: homeassistant/components/shelly/const.py: patch does not apply
error: patch failed: homeassistant/components/shelly/manifest.json:1
error: homeassistant/components/shelly/manifest.json: patch does not apply
error: patch failed: homeassistant/components/shelly/strings.json:2
error: homeassistant/components/shelly/strings.json: patch does not apply
error: patch failed: homeassistant/generated/bluetooth.py:702
error: homeassistant/generated/bluetooth.py: patch does not apply
error: patch failed: tests/components/shelly/test_config_flow.py:1
error: tests/components/shelly/test_config_flow.py: patch does not apply
Почему не удается применить изменения, хотя сам путь получен из прямой разницы между двумя коммитами?
Кстати, оба коммита напрямую связаны и находятся в одной и той же ветке dev.
Пытаясь локально запустить несколько тестов основной кодовой базы, я сделал следующее: [code]git clone https://github.com/home-assistant/core.git
# create & activate venv ...
# Go to base commit git checkout
# Extract difference git diff > diff.patch
# Modify patch & keep only target files by deleting extra content
[/code] [h4]Проблема возникает на этом этапе[/h4] [code]# Apply the patch git apply golden.patch error: No valid patches in input (allow with "--allow-empty")
# After saving the patch with encoding utf-8: git apply diff.patch diff.patch:7: trailing whitespace. """BLE provisioning helpers for Shelly integration.""" diff.patch:8: trailing whitespace.
diff.patch:9: trailing whitespace. from __future__ import annotations diff.patch:10: trailing whitespace.
diff.patch:11: trailing whitespace. import asyncio error: patch failed: homeassistant/components/shelly/config_flow.py:2 error: homeassistant/components/shelly/config_flow.py: patch does not apply error: patch failed: homeassistant/components/shelly/const.py:36 error: homeassistant/components/shelly/const.py: patch does not apply error: patch failed: homeassistant/components/shelly/manifest.json:1 error: homeassistant/components/shelly/manifest.json: patch does not apply error: patch failed: homeassistant/components/shelly/strings.json:2 error: homeassistant/components/shelly/strings.json: patch does not apply error: patch failed: homeassistant/generated/bluetooth.py:702 error: homeassistant/generated/bluetooth.py: patch does not apply error: patch failed: tests/components/shelly/test_config_flow.py:1 error: tests/components/shelly/test_config_flow.py: patch does not apply [/code] [b]Почему не удается применить изменения, хотя сам путь получен из прямой разницы между двумя коммитами?[/b] Кстати, оба коммита напрямую связаны и находятся в одной и той же ветке dev.