Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
Agent eval: Copy `.rules` file into eval worktree for examples based on Zed (#29116)
Michael Sloan0f3ac3833209
diff --git a/crates/eval/examples/find_and_replace_diff_card/base.toml b/crates/eval/examples/find_and_replace_diff_card/base.tomlindex 9cc9370bc6c..c88298997d1 100644--- a/crates/eval/examples/find_and_replace_diff_card/base.toml+++ b/crates/eval/examples/find_and_replace_diff_card/base.toml@@ -1,3 +1,3 @@url = "https://github.com/zed-industries/zed.git"-revision = "03ecb88fe30794873f191ddb728f597935b3101c"+revision = "38fcadf9481d018543c65f36ac3bafeba190179b"language_extension = "rs"diff --git a/crates/eval/src/example.rs b/crates/eval/src/example.rsindex 058254996fc..a82fbecc93b 100644--- a/crates/eval/src/example.rs+++ b/crates/eval/src/example.rs@@ -37,6 +37,8 @@ pub const WORKTREES_DIR: &str = "./crates/eval/worktrees";const THREAD_EVENT_TIMEOUT: Duration = Duration::from_secs(60 * 2);+const ZED_REPO_URL: &str = "https://github.com/zed-industries/zed.git";+#[derive(Clone, Debug, Deserialize)]pub struct ExampleBase {pub url: String,@@ -226,6 +228,10 @@ impl Example {.await?;}+ if self.base.url == ZED_REPO_URL {+ std::fs::write(worktree_path.join(".rules"), std::fs::read(".rules")?)?;+ }+std::fs::create_dir_all(self.example_output_directory())?;Ok(())@@ -637,7 +643,11 @@ impl Example {async fn repository_diff(&self) -> Result<String> {let worktree_path = self.worktree_path();run_git(&worktree_path, &["add", "."]).await?;- run_git(&worktree_path, &["diff", "--staged"]).await+ let mut diff_args = vec!["diff", "--staged"];+ if self.base.url == ZED_REPO_URL {+ diff_args.push(":(exclude).rules");+ }+ run_git(&worktree_path, &diff_args).await}}