salt/changelog/59806.fixed.md
Krzysztof Pawłowski 30690637b5 Return error if patch file passed to state file.patch is malformed
If patch file provided for file.patch state is malformed then state
returns `Patch was already applied` but patch is not applied.

          ID: patch_example
    Function: file.patch
        Name: /tmp/example
      Result: True
     Comment: Patch was already applied
     Started: 12:20:50.953163
    Duration: 61.558 ms
     Changes:

It is better to return error in such case.

          ID: patch_example
    Function: file.patch
        Name: /tmp/example
      Result: False
     Comment: /usr/bin/patch: **** malformed patch at line 7:
     Started: 12:33:44.915605
    Duration: 59.202 ms
     Changes:
2023-12-10 15:32:15 -07:00

68 B

Return error if patch file passed to state file.patch is malformed.