Merge origin/main into fix/tunnel-traversal (conflict-only)
Conflict in ingestion/internal/brainfs/brainfs_test.go only: both sides appended a test after TestReadRegularNeverReturnsAnInBrainFileSwappedInBehindASymlink (this branch: TestWriteRegularRefusesFinalSymlinksFIFOsEscapesAndMissingFilesAndRewritesRegularFiles; main: TestReadDirDirsListsOnlyRealSubdirsAndRefusesSymlinkedComponents). Kept both, unchanged. No production code touched by the resolution. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -104,6 +104,27 @@ func (b *Brain) ReadDirRegular(relDir string) ([]string, error) {
|
||||
return names, nil
|
||||
}
|
||||
|
||||
// ReadDirDirs lists the real subdirectories directly in a brain-relative
|
||||
// directory, by name. Every component of relDir must be a real directory
|
||||
// (ErrNotRegular otherwise); symlinks to directories are left out.
|
||||
func (b *Brain) ReadDirDirs(relDir string) ([]string, error) {
|
||||
relDir = filepath.ToSlash(relDir)
|
||||
if err := b.realDir(relDir); err != nil {
|
||||
return nil, err
|
||||
}
|
||||
ents, err := fs.ReadDir(b.root.FS(), relDir)
|
||||
if err != nil {
|
||||
return nil, err
|
||||
}
|
||||
var names []string
|
||||
for _, e := range ents {
|
||||
if e.Type().IsDir() {
|
||||
names = append(names, e.Name())
|
||||
}
|
||||
}
|
||||
return names, nil
|
||||
}
|
||||
|
||||
// ReadRegular reads a brain-relative path, refusing anything that is not a
|
||||
// regular file, both before the open and on the opened handle.
|
||||
func (b *Brain) ReadRegular(rel string) ([]byte, error) {
|
||||
|
||||
Reference in New Issue
Block a user