mount: load mount root before reporting readiness

This commit is contained in:
Michael Eischer
2026-02-17 22:41:01 +01:00
parent 3dcd60d979
commit b24d210b45
+11 -6
View File
@@ -196,12 +196,12 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args
PathTemplates: opts.PathTemplates,
}
root := fuse.NewRoot(repo, cfg)
printer.S("Now serving the repository at %s", mountpoint)
printer.S("Use another terminal or tool to browse the contents of this folder.")
printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.")
debug.Log("serving mount at %v", mountpoint)
// load repository before reporting the mountpoint
printer.S("Loading snapshots...")
_, err = root.ReadDirAll(ctx)
if err != nil {
return err
}
done := make(chan struct{})
@@ -210,6 +210,11 @@ func runMount(ctx context.Context, opts MountOptions, gopts global.Options, args
err = fs.Serve(c, root)
}()
printer.S("Now serving the repository at %s", mountpoint)
printer.S("Use another terminal or tool to browse the contents of this folder.")
printer.S("When finished, quit with Ctrl-c here or umount the mountpoint.")
debug.Log("serving mount at %v", mountpoint)
select {
case <-ctx.Done():
debug.Log("running umount cleanup handler for mount at %v", mountpoint)