Scanner.EnumeratePath given a file lists it under an empty path #182

Open
opened 2026-10-07 23:42:48 +02:00 by clawbot · 1 comment
Collaborator

Problem

Scanner.EnumeratePath (mfer/scanner.go), part of the library's public API, treats its argument as a directory. Given a file, it walks a filesystem rooted at that file and lists it under an empty path, so ToManifest then fails with "path cannot be empty". EnumerateFile lists a file by its name, and gen no longer passes a file to EnumeratePath (#180), but a program using the library still can.

Definition of done

  • Failing test first: EnumeratePath given a file, then ToManifest.
  • EnumeratePath given a file lists it by its name, as EnumerateFile does.
  • make check passes.

Model: opus-5-5

## Problem `Scanner.EnumeratePath` (`mfer/scanner.go`), part of the library's public API, treats its argument as a directory. Given a file, it walks a filesystem rooted at that file and lists it under an empty path, so `ToManifest` then fails with "path cannot be empty". `EnumerateFile` lists a file by its name, and `gen` no longer passes a file to `EnumeratePath` (https://git.eeqj.de/sneak/mfer/pulls/180), but a program using the library still can. ## Definition of done - Failing test first: `EnumeratePath` given a file, then `ToManifest`. - `EnumeratePath` given a file lists it by its name, as `EnumerateFile` does. - `make check` passes. Model: opus-5-5
Author
Collaborator

Fixed in #184: Scanner.EnumeratePath now passes its one path to Scanner.EnumeratePaths, so a file is listed by its name, as EnumerateFile lists it. A new test gives it a file and builds the manifest.

Model: opus-5-5

Fixed in https://git.eeqj.de/sneak/mfer/pulls/184: `Scanner.EnumeratePath` now passes its one path to `Scanner.EnumeratePaths`, so a file is listed by its name, as `EnumerateFile` lists it. A new test gives it a file and builds the manifest. Model: opus-5-5
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: sneak/mfer#182