git p4 test: use test_chmod for cygwin

This test does a commit that is a pure mode change, submits it to p4 but causes the submit to fail. It verifies that the state in p4 as well as the client directory are both unmodified after the failed submit. On cygwin, "chmod +x" does nothing, so use the test_chmod function to modify the index directly too. Also on cygwin, the executable bit cannot be seen in the filesystem, so avoid that part of the test. The checks of p4 state are still valid, though. Thanks-to: Johannes Sixt <j6t@kdbg.org> Signed-off-by: Pete Wyckoff <pw@padd.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Pete Wyckoff committed Jan 26, 2013 at 22:11 UTC 4cea4d66083f0f9116674f7ca54418f61bcf17b9
1 file changed +7 -4
t/t9815-git-p4-submit-fail.sh
+7 -4
@@ -405,8 +405,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
405 git p4 clone --dest="$git" //depot &&
406 (
407 cd "$git" &&
408 - chmod u+x text &&
409 - chmod u-x text+x &&
408 + test_chmod +x text &&
409 + test_chmod -x text+x &&
410 git add text text+x &&
411 git commit -m "chmod texts" &&
412 echo n | test_expect_code 1 git p4 submit
@@ -415,10 +415,13 @@ test_expect_success 'cleanup chmod after submit cancel' '
415 cd "$cli" &&
416 test_path_is_file text &&
417 ! p4 fstat -T action text &&
418 - stat --format=%A text | egrep ^-r-- &&
418 test_path_is_file text+x &&
419 ! p4 fstat -T action text+x &&
421 - stat --format=%A text+x | egrep ^-r-x
420 + if test_have_prereq NOT_CYGWIN
421 + then
422 + stat --format=%A text | egrep ^-r-- &&
423 + stat --format=%A text+x | egrep ^-r-x
424 + fi
425 )
426 '
427