From 2529cc7a1679d9e2afd98d0094e7b1d1323df0ca Mon Sep 17 00:00:00 2001 From: "gcp-cherry-pick-bot[bot]" <98988430+gcp-cherry-pick-bot[bot]@users.noreply.github.com> Date: Wed, 21 May 2025 11:06:58 -0400 Subject: [PATCH] Don't pass `-z` flag to git-cat-file (cherry-pick #31053) (#31093) Cherry-picked Don't pass `-z` flag to git-cat-file (#31053) Closes #30972 Release Notes: - Fixed a bug that prevented the `copy permalink to line` action from working on systems with older versions of git. Co-authored-by: Cole Miller --- crates/git/src/repository.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/crates/git/src/repository.rs b/crates/git/src/repository.rs index 02b8e1cf89e3f43077be1dbd74bfb5ef3a660c17..5452f24e53892584169a10df4310152f1ffbcf95 100644 --- a/crates/git/src/repository.rs +++ b/crates/git/src/repository.rs @@ -748,7 +748,6 @@ impl GitRepository for RealGitRepository { "--no-optional-locks", "cat-file", "--batch-check=%(objectname)", - "-z", ]) .stdin(Stdio::piped()) .stdout(Stdio::piped()) @@ -761,7 +760,7 @@ impl GitRepository for RealGitRepository { .ok_or_else(|| anyhow!("no stdin for git cat-file subprocess"))?; let mut stdin = BufWriter::new(stdin); for rev in &revs { - write!(&mut stdin, "{rev}\0")?; + write!(&mut stdin, "{rev}\n")?; } drop(stdin);