Files
archie/.okf/codebase/internal/worktree/worktree_test.md
T
sam 7c34bdae5a okf: scaffold knowledge bundle and MCP server config
Adds a harvested .okf/ knowledge bundle (codebase concepts + starter
architecture/services/rules scaffolding) and .mcp.json pointing at the
shared okf MCP service (http://localhost:8765/archie-core/), which
serves multiple projects' bundles from a single process.
2026-07-22 04:36:50 +10:00

1.1 KiB

description, resource, tags, timestamp, title, type
description resource tags timestamp title type
Source module internal/worktree/worktree_test.go (138 lines). internal/worktree/worktree_test.go
go
source
2026-07-21T18:36:22Z worktree_test.go Module

Module worktree_test.go

Path: internal/worktree/worktree_test.go
Lines: 138

Snippet Preview

package worktree

import (
	"context"
	"os"
	"os/exec"
	"path/filepath"
	"strings"
	"testing"
)

// newLocalRemote creates a bare repo with one commit on main and
// returns the directory that serves as the fake forge host: the bare
// repo lives at <host>/<owner>/<repo>.git so cloneURL resolves it via
// file://.
func newLocalRemote(t *testing.T, owner, repo string) string {
	t.Helper()
	host := t.TempDir()
	bare := filepath.Join(host, owner, repo+".git")
	seed := filepath.Join(t.TempDir(), "seed")

	run := func(dir string, args ...string) {
		t.Helper()
		cmd := exec.Command("git", args...)
		cmd.Dir = dir
		cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0")
		if out, err := cmd.CombinedOutput(); err != nil {
			t.Fatalf("git %v: %v\n%s", args, err, out)
		}
	}