'use server';
import { resolve } from '../../lib/server-container.js';
/**
 * Server action that returns all branch names (local + remote) for a repository.
 * Used by the adopt branch drawer to populate the branch combobox.
 */
export async function listBranches(repositoryPath) {
    if (!repositoryPath?.trim()) {
        return [];
    }
    try {
        const worktreeService = resolve('IWorktreeService');
        return await worktreeService.listBranches(repositoryPath);
    }
    catch {
        return [];
    }
}
