const invoke = window.__TAURI__?.core?.invoke; function ensureInvoke() { if (!invoke) { throw new Error("Tauri invoke API is not available."); } } export async function runGitClone(repoUrl, destinationPath, gitPath) { ensureInvoke(); return invoke("git_clone", { repoUrl, destinationPath, gitPath: gitPath || null, }); } export async function runGitPull(repoPath, gitPath) { ensureInvoke(); return invoke("git_pull", { repoPath, gitPath: gitPath || null }); } export async function runGitPush(repoPath, gitPath) { ensureInvoke(); return invoke("git_push", { repoPath, gitPath: gitPath || null }); } export async function runGitStatus(repoPath, gitPath) { ensureInvoke(); return invoke("git_status", { repoPath, gitPath: gitPath || null }); } export async function runGitBranch(repoPath, gitPath) { ensureInvoke(); return invoke("git_branch", { repoPath, gitPath: gitPath || null }); } export async function testGiteaConnection(payload) { ensureInvoke(); return invoke("test_gitea_connection", payload); }