Skip to content

Commit

Permalink
git p4 test: use test_chmod for cygwin
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pete Wyckoff authored and Junio C Hamano committed Jan 27, 2013
1 parent e9df0f9 commit 4cea4d6
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions t/t9815-git-p4-submit-fail.sh
Original file line number Diff line number Diff line change
Expand Up @@ -405,8 +405,8 @@ test_expect_success 'cleanup chmod after submit cancel' '
git p4 clone --dest="$git" //depot &&
(
cd "$git" &&
chmod u+x text &&
chmod u-x text+x &&
test_chmod +x text &&
test_chmod -x text+x &&
git add text text+x &&
git commit -m "chmod texts" &&
echo n | test_expect_code 1 git p4 submit
Expand All @@ -415,10 +415,13 @@ test_expect_success 'cleanup chmod after submit cancel' '
cd "$cli" &&
test_path_is_file text &&
! p4 fstat -T action text &&
stat --format=%A text | egrep ^-r-- &&
test_path_is_file text+x &&
! p4 fstat -T action text+x &&
stat --format=%A text+x | egrep ^-r-x
if test_have_prereq NOT_CYGWIN
then
stat --format=%A text | egrep ^-r-- &&
stat --format=%A text+x | egrep ^-r-x
fi
)
'

Expand Down

0 comments on commit 4cea4d6

Please sign in to comment.