fix(fermata): an editor's swap or backup file no longer refuses
One non-UTF-8 .env.swp blocked everything a checkout sent across a link, and would withhold every tool output under deny. A discovered *.swp, *.swo, *.swn, *.swx or *~ that cannot be read or parsed is now passed over under every setting. One that can be parsed stays known to the redactor. .bak, .env.gpg and [[file]] overrides keep the rule.
This commit is contained in:
@@ -225,6 +225,16 @@ fn other_settings_stay_open_and_quote_nothing() {
|
||||
}
|
||||
}
|
||||
|
||||
/// An editor's file does not take down every tool output of a `deny` project.
|
||||
#[test]
|
||||
fn an_editors_swap_file_does_not_withhold_under_deny() {
|
||||
let p = project(&[(".botsecrets", DENY), (".env", "API_TOKEN=value-on-the-failing-line\n")]);
|
||||
fs::write(p.dir.path().join(".env.swp"), b"b0VIM \xff\xfe\x00\x01").unwrap();
|
||||
let (out, _) = p.post(json!(RESPONSE));
|
||||
let text = out["hookSpecificOutput"]["updatedToolOutput"].as_str().unwrap();
|
||||
assert!(text.starts_with("output of the tool") && !text.contains(VALUE), "{text}");
|
||||
}
|
||||
|
||||
// ---------------------------------------------------------------------------
|
||||
// PreToolUse
|
||||
// ---------------------------------------------------------------------------
|
||||
|
||||
Reference in New Issue
Block a user