Skip to content

Commit 4cea4d6

Browse files
Pete Wyckoffgitster
authored andcommitted
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>
1 parent e9df0f9 commit 4cea4d6

1 file changed

Lines changed: 7 additions & 4 deletions

File tree

t/t9815-git-p4-submit-fail.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -405,8 +405,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
405405
git p4 clone --dest="$git" //depot &&
406406
(
407407
cd "$git" &&
408-
chmod u+x text &&
409-
chmod u-x text+x &&
408+
test_chmod +x text &&
409+
test_chmod -x text+x &&
410410
git add text text+x &&
411411
git commit -m "chmod texts" &&
412412
echo n | test_expect_code 1 git p4 submit
@@ -415,10 +415,13 @@ test_expect_success 'cleanup chmod after submit cancel' '
415415
cd "$cli" &&
416416
test_path_is_file text &&
417417
! p4 fstat -T action text &&
418-
stat --format=%A text | egrep ^-r-- &&
419418
test_path_is_file text+x &&
420419
! 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
422425
)
423426
'
424427

0 commit comments

Comments
 (0)