about summary refs log tree commit homepage
path: root/t/solver_git.t
diff options
context:
space:
mode:
authorEric Wong <e@80x24.org>2021-05-05 17:49:43 +0000
committerEric Wong <e@80x24.org>2021-05-05 19:50:03 +0000
commit274d3476320aebc93ead7c5da4f716a12d43167f (patch)
tree6a93daf6b3ae57999df85da330dc4583eb7232ef /t/solver_git.t
parentf1921e46e16cabb6f705236581564b8fe901a76e (diff)
downloadpublic-inbox-274d3476320aebc93ead7c5da4f716a12d43167f.tar.gz
Don't lose file mode information when regenerating a diff.
Diffstat (limited to 't/solver_git.t')
-rw-r--r--t/solver_git.t13
1 files changed, 13 insertions, 0 deletions
diff --git a/t/solver_git.t b/t/solver_git.t
index 44cbbfdb..ad0c295b 100644
--- a/t/solver_git.t
+++ b/t/solver_git.t
@@ -73,6 +73,19 @@ test_lei({tmpdir => "$tmpdir/rediff"}, sub {
         lei_ok(qw(rediff -q -U9 t/solve/0001-simple-mod.patch));
         like($lei_out, qr!^\Q+++\E b/TODO\n@@ -103,9 \+103,11 @@!sm,
                 'got more context with -U9');
+        lei_ok(qw(rediff -q -U9 t/solve/bare.patch));
+        my $exp = <<'EOM';
+diff --git a/script/public-inbox-extindex b/script/public-inbox-extindex
+old mode 100644
+new mode 100755
+index 15ac20eb..771486c4
+--- a/script/public-inbox-extindex
++++ b/script/public-inbox-extindex
+@@ -1,13 +1,12 @@
+ #!perl -w
+EOM
+        ok(index($lei_out, $exp) >= 0,
+                'preserve mode, regen header + context from -U0 patch');
 });
 
 test_lei({tmpdir => "$tmpdir/index-eml-only"}, sub {