The Forgejo API requires file content to be base64-encoded, but the MCP tools were passing plain text through, causing "illegal base64 data" errors. Now the server encodes content automatically so AI models can pass plain text directly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
14 lines
314 B
Go
14 lines
314 B
Go
package forgejo
|
|
|
|
import (
|
|
"sync"
|
|
|
|
forgejo_sdk "codeberg.org/mvdkleijn/forgejo-sdk/forgejo/v2"
|
|
)
|
|
|
|
// SetClientForTesting overrides the singleton client for testing purposes.
|
|
func SetClientForTesting(c *forgejo_sdk.Client) {
|
|
clientOnce = sync.Once{}
|
|
client = c
|
|
clientOnce.Do(func() {}) // mark as initialized
|
|
}
|