codex: fix CI failure on PR #30854

This commit is contained in:
Chris Bookholt
2026-07-06 19:34:17 -07:00
parent 0c28ba5ce2
commit 3117727b70
2 changed files with 16 additions and 9 deletions
+10 -9
View File
@@ -846,15 +846,16 @@ impl<'git> GuardedGitConfig<'git> {
value: &str,
) -> io::Result<()> {
debug_assert!(matches!(name, "clean" | "smudge" | "process" | "required"));
let mut command = self
.sources
.git
.command_for_cwd(&self.sources.canonical_root)?;
command
.args(&self.sources.base_config_args)
.args(["config", "--file"])
.arg(config_path)
.args(["--add", &format!("filter.{driver}.{name}"), value]);
// The destination is operation-owned and absolute. Avoid repository
// setup while serializing the already inventoried driver names: a
// malformed repository setting must not preempt the typed policy
// error that the guarded operation reports later.
let mut command = self.sources.git.command();
command.args(["config", "--file"]).arg(config_path).args([
"--add",
&format!("filter.{driver}.{name}"),
value,
]);
let output = self.sources.git.output(command)?;
if !output.status.success() {
return Err(io::Error::other(format!(
@@ -1242,6 +1242,12 @@ fn malformed_shared_repository_refuses_before_reverse_index_staging() {
let diff = build_three_way_fixture(root);
let index_path = root.join(".git/index");
let before_index = std::fs::read(&index_path).expect("read index before refusal");
let unused_filter = run(root, &["git", "config", "filter.lfs.clean", "cat"]);
assert_eq!(
unused_filter.0, 0,
"configure unused filter: {}",
unused_filter.2
);
let configured = run(
root,
&["git", "config", "core.sharedRepository", "not-a-permission"],