#1122502 git: add -p prompts for removal of binary file, but explodes with "error: cannot apply binary patch to 'file' without full index line" if you y

Package:
git
Source:
git
Description:
fast, scalable, distributed revision control system
Submitter:
наб
Date:
2025-12-11 00:01:02 UTC
Severity:
normal
Tags:
#1122502#5
Date:
2025-12-10 20:53:43 UTC
From:
To:
Dear Maintainer,

$ git init
$ printf 'a\0' > a
$ printf 'b\0' > b
$ git add .
$ git commit -m a
$ printf 'A\0' > a
$ rm b
$ git add -p
diff --git a/b b/b
deleted file mode 100644
index 28eacf2..0000000
Binary files a/b and /dev/null differ
(1/1) Stage deletion [y,n,q,a,d,?]? y
error: cannot apply binary patch to 'b' without full index line
error: b: patch does not apply
error: 'git apply' failed

Best,