MCPcopy Create free account
hub / github.com/AI45Lab/Code / checkout_409_dirty_yields_conflict

Function checkout_409_dirty_yields_conflict

core/src/workspace/remote_git.rs:1099–1118  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1097
1098 #[tokio::test]
1099 async fn checkout_409_dirty_yields_conflict() {
1100 let (server, backend) = server_and_backend().await;
1101 Mock::given(method("POST"))
1102 .and(path("/v1/repos/test/git/checkout"))
1103 .respond_with(ResponseTemplate::new(409).set_body_json(json!({
1104 "error":{"code":"WORKING_TREE_DIRTY","message":"please stash first"}
1105 })))
1106 .mount(&server)
1107 .await;
1108
1109 let err = backend
1110 .checkout(WorkspaceGitCheckoutRequest {
1111 refspec: "main".into(),
1112 force: false,
1113 })
1114 .await
1115 .unwrap_err();
1116 let c = err.downcast_ref::<RemoteGitConflict>().unwrap();
1117 assert_eq!(c.code, "WORKING_TREE_DIRTY");
1118 }
1119
1120 #[tokio::test]
1121 async fn diff_passes_target_through_and_surfaces_server_truncation() {

Callers

nothing calls this directly

Calls 2

server_and_backendFunction · 0.85
checkoutMethod · 0.45

Tested by

no test coverage detected