GitFileSystem class abstract interface Testing

The file operations the process backend performs, injectable so they can run without a disk.

It is the seam behind every disk access of the backend: repository creation guards, git directory files, conflict markers, patches and temporary indexes either delegate to the machine's file system or, in tests, keep the files in memory.

Paths are handed over as they are; absolutePath turns them absolute. Failing operations throw, and the concrete error type is left to the implementation.

Implementers

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

absolutePath(String path) → String
Returns path as an absolute path, resolving relative paths against the implementation's current directory.
createDirectory(String path, {bool recursive = false}) → Future<void>
Creates a directory at path.
createTemporaryDirectory(String prefix) → Future<String>
Creates a fresh empty directory for temporary use and returns its absolute path. Two calls never return the same path.
deleteDirectory(String path, {bool recursive = false}) → Future<void>
Deletes the directory at path.
exists(String path) → Future<bool>
Whether anything — a file or a directory — exists at path.
isDirectory(String path) → Future<bool>
Whether a directory exists at path. A file at path yields false.
Whether a symbolic link or a Windows junction sits at path, without following it.
list(String path) → Future<List<GitFileSystemEntry>>
Lists the direct children of the directory at path, sorted by name.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
readBytes(String path) → Future<Uint8List>
Reads the bytes of the file at path.
Resolves every symbolic link and Windows junction in path and returns the absolute path it designates.
toString() → String
A string representation of this object.
inherited
writeBytes(String path, List<int> bytes) → Future<void>
Writes bytes to the file at path, creating or replacing it.

Operators

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