mirror of
https://github.com/instructkr/claw-code.git
synced 2026-11-18 00:00:00 +08:00
fix(#801): diff non-git-dir error envelope now includes error_kind, hint, and message fields
This commit is contained in:
1 parent
1201dc60ef
commit
53953a8157
3 files changed
+41
No files matched your search
@@ -8331,11 +8331,15 @@ fn render_diff_json_for(cwd: &Path) -> Result<serde_json::Value, Box<dyn std::er
|
||||
.map(|o| o.status.success())
|
||||
.unwrap_or(false);
|
||||
if !in_git_repo {
|
||||
// #801: add error_kind, hint, message fields for envelope parity with other error paths
|
||||
return Ok(serde_json::json!({
|
||||
"kind": "diff",
|
||||
"action": "diff",
|
||||
"status": "error",
|
||||
"error_kind": "no_git_repo",
|
||||
"result": "no_git_repo",
|
||||
"message": format!("{} is not inside a git project", cwd.display()),
|
||||
"hint": "Run `git init` to create a repository, or change to a directory that is inside a git project.",
|
||||
"working_directory": cwd.display().to_string(),
|
||||
"detail": format!("{} is not inside a git project", cwd.display()),
|
||||
}));
|
||||
|
||||
Reference in new issue
Block a user