From 2d6d5585329aa76ac26ae09a393b73764afea54d Mon Sep 17 00:00:00 2001 From: Omer Bektas Date: Fri, 16 Oct 2026 11:45:41 +0300 Subject: [PATCH] fix(cli): normalize repository root paths --- .changeset/clean-roots-match.md | 5 +++++ src/cli/internal/context.test.ts | 9 +++++++++ src/cli/internal/context.ts | 3 ++- 3 files changed, 16 insertions(+), 1 deletion(-) create mode 100644 .changeset/clean-roots-match.md create mode 100644 src/cli/internal/context.test.ts diff --git a/.changeset/clean-roots-match.md b/.changeset/clean-roots-match.md new file mode 100644 index 0000000..04dbd2b --- /dev/null +++ b/.changeset/clean-roots-match.md @@ -0,0 +1,5 @@ +--- +'frog': patch +--- + +Normalize Git repository roots before binding the file store so Windows commands accept equivalent path separators. diff --git a/src/cli/internal/context.test.ts b/src/cli/internal/context.test.ts new file mode 100644 index 0000000..d85fe79 --- /dev/null +++ b/src/cli/internal/context.test.ts @@ -0,0 +1,9 @@ +import path from 'node:path' +import * as helpers from '../../../test/helpers.js' +import * as context from './context.js' + +test('behavior: normalizes the repository root for local consumers', async () => { + const cwd = await helpers.repo() + + expect((await context.resolve({ cwd })).root).toBe(path.resolve(cwd)) +}) diff --git a/src/cli/internal/context.ts b/src/cli/internal/context.ts index fc9a591..e98c271 100644 --- a/src/cli/internal/context.ts +++ b/src/cli/internal/context.ts @@ -1,3 +1,4 @@ +import path from 'node:path' import { z } from 'incur' import * as Config from '../../Config.js' import * as Git from '../../Git.js' @@ -17,7 +18,7 @@ export type Context = { */ export async function resolve(options: resolve.Options = {}): Promise { const cwd = options.cwd ?? process.cwd() - const root = (await Git.root({ cwd })) ?? cwd + const root = path.resolve((await Git.root({ cwd })) ?? cwd) const remote = await Git.repo({ cwd: root }) const config = await Config.resolve({ root,