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

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

 



Shuqi Liang <cheskaqiqi@xxxxxxxxx> writes:

> 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

Hardcoding 8e27be assumes we only support SHA-1 but there is a CI
test job that runs everything in SHA-256 mode, so it is likely
to break if you wrote it like so.  Something along the lines of ...

	FN=newdirectory/testfile &&
	OID=$(git hash-object $FN) &&
	ZERO=$(test_oid zero) &&
	echo ":100644 100644 $OID $ZERO M new $FN" >expect

... may have a better chance to be correct, but I didn't test ;-)



[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