LocalRepositoryAdapter class

A RepositoryAdapter backed by a local checkout on disk.

Filesystem operations use dart:io; git operations shell out to the git binary via Process.run with workingDirectory pinned to root (arguments are passed as a list, never a shell string, so nothing is interpolated into a shell). Every path is resolved and confined to root; anything escaping it raises a RepoException.

This is the only dart:io-bound adapter, so it lives behind the io-layer export (apollovm_mcp_io.dart).

Implemented types

Constructors

LocalRepositoryAdapter(String path, {RepoConfig config = const RepoConfig()})
Opens the workspace rooted at path (which must exist).
factory

Properties

capabilities → RepoCapabilities
What this adapter can/‌may do, so tools can report unsupported operations cleanly.
no setteroverride
config → RepoConfig
final
hashCode → int
The hash code for this object.
no setterinherited
root → String
The absolute, resolved workspace root. All paths are confined here.
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

delete(String path) → Future<void>
Deletes the file or directory path.
override
edit(String path, String oldString, String newString, {bool replaceAll = false, int? atLine}) → Future<RepoEdit>
Replaces oldString with newString in path. When replaceAll is false exactly one occurrence must match. When atLine is given, the match must occur on that 1-based line or the edit is rejected.
override
find({String? glob, int? limit}) → Future<List<String>>
Finds files whose workspace-relative path matches glob (returns up to limit paths).
override
gitAdd(List<String> paths) → Future<GitResult>
override
gitBlame(String path) → Future<List<GitBlameLine>>
override
gitCheckout(String rev) → Future<GitResult>
override
gitCommit(String message, {List<String>? paths}) → Future<GitResult>
override
gitDiff({String? rev, bool staged = false, String? path}) → Future<String>
override
gitLog({int? limit, String? path}) → Future<List<GitCommit>>
override
gitRestore(List<String> paths, {bool staged = false}) → Future<GitResult>
override
gitShow({required String rev, String? path}) → Future<String>
override
gitStatus() → Future<List<GitStatusEntry>>
override
list(String path, {bool recursive = false, int? maxDepth, String? glob}) → Future<List<RepoEntry>>
Lists the directory at path. When recursive, descends up to maxDepth levels; glob filters entries by name/path pattern.
override
mkdir(String path) → Future<void>
Creates the directory path (and any missing parents).
override
move(String from, String to) → Future<void>
Moves/renames from to to.
override
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
read(String path, {LineRange? range}) → Future<RepoFile>
Reads path, optionally only the lines in range.
override
searchText(String pattern, {String? glob, bool ignoreCase = false, int context = 0, int? limit}) → Future<List<TextMatch>>
Searches file contents for pattern (a regular expression). glob limits which files are searched; context lines of surrounding text are attached.
override
stat(String path) → Future<RepoStat>
Metadata for path (never throws for a missing path — returns exists: false).
override
toString() → String
A string representation of this object.
inherited
write(String path, String content) → Future<RepoEdit>
Creates or overwrites path with content.
override

Operators

operator ==(Object other) → bool
The equality operator.
inherited