about summary refs log tree commit homepage
path: root/lib/PublicInbox/SolverGit.pm
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2019-11-14 01:03:38 +0000
committerEric Wong <e@80x24.org>2019-11-14 06:42:32 +0000
commit2dd86683ec2f237538766d4d632de7cb2dd0f3e3 (patch)
tree2c988253884a406003e1382091211eb1ccd2485b /lib/PublicInbox/SolverGit.pm
parentf908cdcc48ae3b7e67d85c2059169f2e22384d1f (diff)
downloadpublic-inbox-2dd86683ec2f237538766d4d632de7cb2dd0f3e3.tar.gz
I sometimes post context-free documentation patches generated
with "-U0" to reduce size and bandwidth overhead when replacing
URLs or updating copyright notices.  git-apply(1) needs the
--unidiff-zero switch to work properly with context-free
patches.

Given our search looks for blob OIDs, and we're never going
to be running the code we regenerate, "--unidiff-zero" ought
to be safe.
Diffstat (limited to 'lib/PublicInbox/SolverGit.pm')
-rw-r--r--lib/PublicInbox/SolverGit.pm2
1 files changed, 1 insertions, 1 deletions
diff --git a/lib/PublicInbox/SolverGit.pm b/lib/PublicInbox/SolverGit.pm
index b7327ffa..95334d7a 100644
--- a/lib/PublicInbox/SolverGit.pm
+++ b/lib/PublicInbox/SolverGit.pm
@@ -450,7 +450,7 @@ sub do_git_apply ($) {
 
         # we need --ignore-whitespace because some patches are CRLF
         my @cmd = (qw(git -C), $dn, qw(apply --cached --ignore-whitespace
-                        --whitespace=warn --verbose));
+                        --unidiff-zero --whitespace=warn --verbose));
         my $len = length(join(' ', @cmd));
         my $total = $self->{tot};
         my $di; # keep track of the last one for "git ls-files"