Revert Error - this operation must be run in a work tree

Hi,

I get this error message whenever I try to revert the commit in Gitea repo. Any idea what is the cause and how to fix this?

  2023/07/21 10:06:24 ...rvices/pull/patch.go:237:AttemptThreeWayMerge() [E] Unable to run read-tree -m! Error: exit status 128 - fatal: this operation must be run in a work tree
  - fatal: this operation must be run in a work tree