Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion cmux-tui/crates/cmux-tui-core/src/apps/grants.rs
Original file line number Diff line number Diff line change
Expand Up @@ -346,7 +346,10 @@ mod tests {
fn a_toast_needs_no_grant_but_not_a_preview_or_a_stopping_app() {
let table = ScopeTable::get();
let params = json!({"title": "Saved"});
assert_eq!(table.check("toast.show", &params, &grant(&[])), Decision::Allow(OpClass::Mutation));
assert_eq!(
table.check("toast.show", &params, &grant(&[])),
Decision::Allow(OpClass::Mutation)
);
let preview = Grant { preview: true, ..grant(&[]) };
assert!(matches!(table.check("toast.show", &params, &preview), Decision::ScopeMissing(_)));
let revoked = Grant { revoked: true, ..grant(&[]) };
Expand Down
4 changes: 2 additions & 2 deletions cmux-tui/crates/cmux-tui-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ mod conversation_search;
mod conversation_store;
pub mod daemon_env;
use cmux_tui_util::debug_spans;
#[cfg(unix)]
pub mod blob_fetch;
mod browser_profile_ops;
mod browser_site_engines;
pub mod diagnostics;
Expand All @@ -42,8 +44,6 @@ mod event_bus;
pub mod fs_ops;
mod git_ops;
#[cfg(unix)]
pub mod blob_fetch;
#[cfg(unix)]
pub mod git_seed;
mod history_ops;
pub mod history_search;
Expand Down
13 changes: 11 additions & 2 deletions cmux-tui/crates/cmux-tui/src/link/sync_cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -837,7 +837,10 @@ fn push_inner(
for (path, revisions) in &left.written {
let Some(relative) = path.strip_prefix(&prefix) else { continue };
if !plain_relative(relative)
|| previous.files.get(relative).is_some_and(|pushed| revisions.contains(&pushed.revision))
|| previous
.files
.get(relative)
.is_some_and(|pushed| revisions.contains(&pushed.revision))
{
continue;
}
Expand Down Expand Up @@ -939,7 +942,13 @@ fn push_inner(
// Through the store, the machine fetches first; what it did not write
// goes over the link below, like every other write.
let fetched = if via_store {
Some(send_through_store(&mut remote, remote_root, &deferred, tally.done, &mut tally.progress)?)
Some(send_through_store(
&mut remote,
remote_root,
&deferred,
tally.done,
&mut tally.progress,
)?)
} else {
None
};
Expand Down
17 changes: 9 additions & 8 deletions cmux-tui/crates/cmux-tui/src/link/sync_cli/store.rs
Original file line number Diff line number Diff line change
Expand Up @@ -140,7 +140,9 @@ pub(super) fn fence(remote: &mut Remote, remote_root: &str) -> anyhow::Result<Le
.downcast_ref::<super::remote::FsRefusal>()
.is_some_and(|refusal| refusal.code == "blob.no_job") => {}
Err(error) => {
return Err(error.context("cannot read what the machine's earlier store fetch wrote"));
return Err(
error.context("cannot read what the machine's earlier store fetch wrote")
);
}
}
}
Expand All @@ -163,8 +165,7 @@ fn written_by(
) -> anyhow::Result<()> {
let mut from = 0u64;
loop {
let page =
remote.call("blob.fetch.status", json!({ "job": job, "written_from": from }))?;
let page = remote.call("blob.fetch.status", json!({ "job": job, "written_from": from }))?;
let entries = page.get("written").and_then(Value::as_array).cloned().unwrap_or_default();
for entry in &entries {
if let (Some(path), Some(revision)) = (
Expand Down Expand Up @@ -450,10 +451,10 @@ pub(super) fn send(
let Some(job) = started.get("job").and_then(Value::as_str).map(str::to_owned) else {
return Err(match fence(remote, remote_root) {
Ok(_) => anyhow!("blob.fetch.start answered no job"),
Err(fenced) => {
Unsettled(format!("blob.fetch.start answered no job; and the cancel failed: {fenced:#}"))
.into()
}
Err(fenced) => Unsettled(format!(
"blob.fetch.start answered no job; and the cancel failed: {fenced:#}"
))
.into(),
});
};
let deadline = Instant::now() + FETCH_DEADLINE;
Expand Down Expand Up @@ -492,7 +493,7 @@ pub(super) fn send(
written_by(remote, &job, &mut |path, revision| {
sent.written.insert(path, revision);
})
.context("cannot read what the machine's fetch wrote")?;
.context("cannot read what the machine's fetch wrote")?;
Ok(sent)
}

Expand Down
Loading