break; case 'getBranches': if (isset($_GET['path'])) { $result = $git->getBranches(getWorkspacePath($_GET['path'])); if ($result === false) { echo '{"status":"error","message":"Failed to get branches!"}'; } else { echo '{"status":"success","data":' . json_encode($result) . '}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'newBranch': if (isset($_GET['path']) && isset($_GET['name'])) { $result = $git->newBranch(getWorkspacePath($_GET['path']), $_GET['name']); if ($result === false) { echo '{"status":"error","message":"Failed to create branch!"}'; } else { echo '{"status":"success","message": "New branch created."}'; } } else { echo '{"status":"error","message":"Missing parameter!"}'; } break; case 'deleteBranch': if (isset($_GET['path']) && isset($_GET['name'])) { $result = $git->deleteBranch(getWorkspacePath($_GET['path']), $_GET['name']); if ($result === false) { echo '{"status":"error","message":"Failed to delete branch!"}'; } else {