╭ changed ───────────╮ │src/serve_common.zig│ ╰────────────────────╯ ╭───────────╮ │← all files│ ╰───────────╯ ╭────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╮ │ 1 const std = @import("std"); │ │ 2 const evt = @import("./event.zig"); │ │ 3 +const rp = @import("xit").repo; │ │ 4 + │ │ 5 +// progress is optional and best effort: a failed report must not fail the work │ │ 6 +pub fn reportProgress(comptime repo_opts: rp.RepoOpts(.xit), io: std.Io, progress_ctx_maybe: ?repo_opts.ProgressCtx, event: rp.ProgressEvent) void {│ │ 7 + if (repo_opts.ProgressCtx != void) { │ │ 8 + if (progress_ctx_maybe) |progress_ctx| progress_ctx.run(io, event) catch {}; │ │ 9 + } │ │10 +} │ │11 │ │12 // the outcome of resolving a requested repo path to its on-disk directory. │ │13 // the http and ssh paths each map the cases to their own error responses. │ ╰────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────╯