Skip to content

The fastest, cheapest, most efficient open-source agent harness. Run more than 500 agents on a $10 VPS.

fix(git-tool): suppress textconv on git_diff, not just external diff

M3gA-Mind34fe8e90d4a7
diff --git a/src/openhuman/tools/impl/filesystem/git_operations.rs b/src/openhuman/tools/impl/filesystem/git_operations.rs
index c96d1dd7fa..1fbcd7dd5c 100644
--- a/src/openhuman/tools/impl/filesystem/git_operations.rs
+++ b/src/openhuman/tools/impl/filesystem/git_operations.rs
@@ -177,7 +177,17 @@ impl GitOperationsTool {
// `--no-ext-diff` is where external-diff suppression has to live: it is
// a diff-command flag, and the `-c diff.external=` that used to stand in
// for it made git exec the empty string instead of disabling anything.
- let mut git_args = vec!["diff", "--no-ext-diff", "--unified=3"];
+ //
+ // `--no-textconv` is a SEPARATE mechanism and needs its own flag.
+ // `--no-ext-diff` covers `diff.external` and `diff.<driver>.command`;
+ // it does not touch `diff.<driver>.textconv`, which a `.gitattributes`
+ // line (`*.bin diff=evil`) can select and which git then EXECUTES to
+ // render a binary file as text. Verified against a scratch repo: with
+ // `--no-ext-diff` alone the textconv script ran; adding
+ // `--no-textconv` it did not. `hardened_git`'s `-c` list cannot close
+ // this — driver names are arbitrary, so there is no finite set of keys
+ // to neutralise, and the suppression has to be a command flag.
+ let mut git_args = vec!["diff", "--no-ext-diff", "--no-textconv", "--unified=3"];
if cached {
git_args.push("--cached");
}