╭─────────────╮ │scroll to top│ ╰─────────────╯ ╭ progress.zig ─────────────────────────────────────────────────╮ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ ╰───────────────────────────────────────────────────────────────╯
╭────╮ ╭ clone ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╮ │http│ ssh │ │ ╰────╯ ╰ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─ ─╯
97 else 98 try std.fmt.bufPrint(&buffer, "{s}: {d}{s}", .{ self.label, self.count, suffix }); 99 if (self.response) |response| { 100 try response.progress(self.writer, text); 101 } else { 102 try xit.net_server_pkt.sendSideband(self.writer, 2, text); 103 try self.writer.flush(); 104 } 105 } 106 }; 107 108 // whether the client the work is reporting to has hung up. only a sideband 109 // reporter probes, so any other context never cancels. 110 pub fn cancelled(comptime repo_opts: rp.RepoOpts(.xit), progress_ctx_maybe: ?repo_opts.ProgressCtx) bool { 111 if (repo_opts.ProgressCtx != *Sideband) return false; 112 const progress_ctx = progress_ctx_maybe orelse return false; 113 return progress_ctx.gone; 114 } 115