Never list index.mf at the top of the tree in gen and freshen (closes #233)
check / check (push) Canceled after 0s

fetch saves the manifest as index.mf at the top of the tree and refuses a
manifest that lists a file there. gen given --output, and freshen with its
manifest outside the base directory, listed such a file, so they wrote
manifests fetch would not take.

gen now leaves out index.mf in each directory it is given, or beside each
file it is given, the same way it leaves out the file it writes. freshen
leaves out index.mf at the top of the base directory. index.mf in a
subdirectory is still listed. The README says so for both commands.

Model: opus-5-5
This commit is contained in:
2026-10-15 21:35:00 +00:00
parent 06127e291f
commit 2b692fad7c
5 changed files with 122 additions and 9 deletions
+9 -4
View File
@@ -411,12 +411,17 @@ func (mfa *CLIApp) freshenScan(
startScan := time.Now()
showProgress := cmd.Bool("progress")
// Leave out the manifest and a temp file left by an interrupted run,
// as gen does. A path that cannot be stat'd, normally because no file
// is there, needs no leaving out.
// Leave out the manifest, a temp file left by an interrupted run, and
// index.mf at the top of the base directory, where fetch saves the
// manifest, as gen does. A path that cannot be stat'd, normally because
// no file is there, needs no leaving out.
var excluded []fs.FileInfo
for _, p := range []string{manifestPath, manifestTempPath(manifestPath)} {
for _, p := range []string{
manifestPath,
manifestTempPath(manifestPath),
filepath.Join(absBase, defaultManifestName),
} {
info, err := mfa.Fs.Stat(p)
if err == nil {
excluded = append(excluded, info)