t7421: eliminate 'grep' check in t7421.4 for mingw compatibility
authorShourya Shukla <redacted>
Thu, 27 Aug 2020 17:45:01 +0000 (23:15 +0530)
committerJunio C Hamano <redacted>
Thu, 27 Aug 2020 18:47:10 +0000 (11:47 -0700)
commitd79b14556922e5b7139268e92f2dface8d174278
tree2ab668dcc18b4caac5577af079df096b7e6c3600
parentf0c6b6467d60d9c8442ebf4a4b4bd53ebc9bcb4e
t7421: eliminate 'grep' check in t7421.4 for mingw compatibility

The 'grep' check in test 4 of t7421 resulted in the failure of t7421 on
Windows due to a different error message

    error: cannot spawn git: No such file or directory

instead of

    fatal: exec 'rev-parse': cd to 'my-subm' failed: No such file or directory

Tighten up the check to compute 'src_abbrev' by guarding the
'verify_submodule_committish()' call using `p->status !='D'`, so that
the former isn't called in case of non-existent submodule directory,
consequently, there is no such error message on any execution
environment. The same need not be implemented for 'dst_abbrev' and is
rather redundant since the conditional 'if (S_ISGITLINK(p->mod_dst))'
already guards the 'verify_submodule_committish()' when we have a
status of 'D'.

Therefore, eliminate the 'grep' check in t7421. Instead, verify the
absence of an error message by doing a 'test_must_be_empty' on the
file containing the error.

Reported-by: Johannes Schindelin <redacted>
Helped-by: Kaartic Sivaraam <redacted>
Mentored-by: Christian Couder <redacted>
Mentored-by: Kaartic Sivaraam <redacted>
Signed-off-by: Shourya Shukla <redacted>
Signed-off-by: Junio C Hamano <redacted>
builtin/submodule--helper.c
t/t7421-submodule-summary-add.sh
git clone https://git.99rst.org/PROJECT