On Tue, Feb 7, 2023 at 3:19 AM Ævar Arnfjörð Bjarmason <avarab@xxxxxxxxx> wrote: > On Mon, Feb 06 2023, Shuqi Liang wrote: > > On Mon, Feb 6, 2023 at 5:44 PM Junio C Hamano <gitster@xxxxxxxxx> wrote: > >> This creates a "test-patch" file with lines 'a' and 'b' that are > >> common context lines without any whitespace before them, no? The > >> original left the necessary single space in front of them (see the > >> line removed above). > > > > I try to change the code to(left the necessary single space in front > > of 'a' and 'b': > > > > @@ -1,2 +1,3 @@ > > - a > > - b > > + a > > + b > > +c > > EOF > > > > t4113-apply-ending.sh (Wstat: 256 Tests: 0 Failed: 0) > > Result: FAIL. > > > > I'm stumped as to why it's still failing. I've tried searching for > > answers on StackOverflow, but I still can't figure it out. > > But this is almost certainly that you're trying to insert leading > whitespace into a line that's in a <<-EOF here-doc, the "-" part of that > means that your leading whitespace is being stripped. Almost. The `<<-` operator actually only strips leading TABs; other whitespace following the TABs is left intact.