From 65434c166ace0726b2d4813fa13f4f678b1e3373 Mon Sep 17 00:00:00 2001 From: Chris Scott <99081550+chriswritescode-dev@users.noreply.github.com> Date: Sun, 1 Feb 2026 21:08:37 -0500 Subject: [PATCH] Remove unused variables from routes and migrations --- backend/src/db/migrations.ts | 3 ++- backend/src/index.ts | 2 +- backend/src/routes/auth.ts | 2 +- backend/test/services/git/GitBranchService.test.ts | 2 -- 4 files changed, 4 insertions(+), 5 deletions(-) diff --git a/backend/src/db/migrations.ts b/backend/src/db/migrations.ts index 8a765671..3f2af61c 100644 --- a/backend/src/db/migrations.ts +++ b/backend/src/db/migrations.ts @@ -163,7 +163,8 @@ function migrateGitTokenToCredentials(db: Database): void { continue } - const { gitToken: _, ...rest } = parsed + const { gitToken: _gitToken, ...rest } = parsed + void _gitToken const migrated = { ...rest, gitCredentials: [{ diff --git a/backend/src/index.ts b/backend/src/index.ts index a4b644e7..7ce32e83 100644 --- a/backend/src/index.ts +++ b/backend/src/index.ts @@ -201,7 +201,7 @@ try { logger.error('Failed to initialize workspace:', error) } -app.route('/api/auth', createAuthRoutes(auth, db)) +app.route('/api/auth', createAuthRoutes(auth)) app.route('/api/auth-info', createAuthInfoRoutes(auth, db)) app.route('/api/health', createHealthRoutes(db)) diff --git a/backend/src/routes/auth.ts b/backend/src/routes/auth.ts index f30b728b..19c24251 100644 --- a/backend/src/routes/auth.ts +++ b/backend/src/routes/auth.ts @@ -5,7 +5,7 @@ import { ENV } from '@opencode-manager/shared/config/env' import { logger } from '../utils/logger' import { hashPassword } from 'better-auth/crypto' -export function createAuthRoutes(auth: AuthInstance, _db: Database) { +export function createAuthRoutes(auth: AuthInstance): Hono { const app = new Hono() app.all('/*', async (c) => { diff --git a/backend/test/services/git/GitBranchService.test.ts b/backend/test/services/git/GitBranchService.test.ts index 8ff5a820..087a0473 100644 --- a/backend/test/services/git/GitBranchService.test.ts +++ b/backend/test/services/git/GitBranchService.test.ts @@ -218,12 +218,10 @@ describe('GitBranchService', () => { it('handles getBranchStatus failure for current branch gracefully', async () => { const mockRepo = { id: 1, fullPath: '/path/to/repo' } getRepoByIdMock.mockReturnValue(mockRepo as any) - let revListCalls = 0 executeCommandMock.mockImplementation((args) => { if (args.includes('rev-parse')) return Promise.resolve('main') if (args.includes('branch')) return Promise.resolve('* main abc123 Initial commit') if (args.includes('rev-list')) { - revListCalls++ return Promise.reject(new Error('No upstream')) } return Promise.resolve('')