diff options
author | Eric Wong <e@80x24.org> | 2021-05-05 17:49:43 +0000 |
---|---|---|
committer | Eric Wong <e@80x24.org> | 2021-05-05 19:50:03 +0000 |
commit | 274d3476320aebc93ead7c5da4f716a12d43167f (patch) | |
tree | 6a93daf6b3ae57999df85da330dc4583eb7232ef /t | |
parent | f1921e46e16cabb6f705236581564b8fe901a76e (diff) | |
download | public-inbox-274d3476320aebc93ead7c5da4f716a12d43167f.tar.gz |
Don't lose file mode information when regenerating a diff.
Diffstat (limited to 't')
-rw-r--r-- | t/solve/bare.patch | 8 | ||||
-rw-r--r-- | t/solver_git.t | 13 |
2 files changed, 21 insertions, 0 deletions
diff --git a/t/solve/bare.patch b/t/solve/bare.patch new file mode 100644 index 00000000..25d7f344 --- /dev/null +++ b/t/solve/bare.patch @@ -0,0 +1,8 @@ +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 +@@ -4 +3,0 @@ +-# Basic tool to create a Xapian search index for a public-inbox. 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 { |