summaryrefslogtreecommitdiffstats
path: root/helpers
diff options
context:
space:
mode:
authorBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-21 20:16:02 +0100
committerBjørn Erik Pedersen <bjorn.erik.pedersen@gmail.com>2024-02-22 15:36:27 +0100
commit16406d9d77cb4861bba9df8ca39e7dadfe41eb45 (patch)
treef32a3921081e40a748613bd87eba7940d6b975db /helpers
parente75784930dca9e367019ce498fd15076a63edb34 (diff)
Fix regression on handling of overlapping file mounts
But note that the overlay file system is set up horizontally (project -> module1 -> module2), so I would not recommend too complex overlapping mount setups within the same module. But this worked in v0.122.0, so we should fix it. Fixes #12103
Diffstat (limited to 'helpers')
-rw-r--r--helpers/general.go9
1 files changed, 8 insertions, 1 deletions
diff --git a/helpers/general.go b/helpers/general.go
index c7d9fcd85..af854041d 100644
--- a/helpers/general.go
+++ b/helpers/general.go
@@ -328,7 +328,14 @@ func PrintFs(fs afero.Fs, path string, w io.Writer) {
}
afero.Walk(fs, path, func(path string, info os.FileInfo, err error) error {
- fmt.Fprintln(w, filepath.ToSlash(path))
+ if err != nil {
+ panic(fmt.Sprintf("error: path %q: %s", path, err))
+ }
+ path = filepath.ToSlash(path)
+ if path == "" {
+ path = "."
+ }
+ fmt.Fprintln(w, path, info.IsDir())
return nil
})
}