Re: [PATCH v4 1/2] t1092: add tests for `git diff-files`

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Junio

On Thu, Mar 9, 2023 at 12:20 PM Junio C Hamano <gitster@xxxxxxxxx> wrote:

>
> > +     run_on_all ../edit-contents deep/a &&
> > +
> > +     test_all_match git diff-files  &&
>
> An extra space on this line.
>
> > +     test_all_match git diff-files deep/a
>
> And on this line.

Will do !


> As output from checkout and index are known to be identical (that is
> one of the things that test_sparse_match does), I do not think there
> is much point checking -out from both sides.
>
> If we know "diff-files" invocation above should never send anything
> to the standard error, then checking that sparse-checkout-err is
> empty may have value, though.

Agree!

> > +     # file present on-disk with modifications
> > +     run_on_sparse ../edit-contents newdirectory/testfile &&
> > +     test_sparse_match git diff-files &&
> > +     test_sparse_match git diff-files newdirectory/testfile
>
> We do not care what the actual output is in this case?

I wonder if the method below is good  to test the actual output for '
file present on-disk with modifications' :

    cat >expect  <<-EOF &&
    :100644 100644 8e27be7d6154a1f68ea9160ef0e18691d20560dc
0000000000000000000000000000000000000000 M newdirectory/testfile
    EOF

     # file present on-disk with modifications
     run_on_sparse ../edit-contents newdirectory/testfile &&
     test_sparse_match git diff-files &&
     test_cmp expect sparse-checkout-out &&
     test_sparse_match git diff-files newdirectory/testfile &&
     test_cmp expect sparse-checkout-out

-------------------
Thanks,
Shuqi




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux