t9200-git-cvsexportcommit: modernize test format
Some tests still use the old format with four spaces indentation. Standardize the tests to the new format with tab indentation. Signed-off-by: John Cai <johncai86@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
@ -50,9 +50,8 @@ check_entries () {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'New file' '
|
||||||
'New file' \
|
mkdir A B C D E F &&
|
||||||
'mkdir A B C D E F &&
|
|
||||||
echo hello1 >A/newfile1.txt &&
|
echo hello1 >A/newfile1.txt &&
|
||||||
echo hello2 >B/newfile2.txt &&
|
echo hello2 >B/newfile2.txt &&
|
||||||
cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
|
cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
|
||||||
@ -73,11 +72,11 @@ test_expect_success \
|
|||||||
test_cmp B/newfile2.txt ../B/newfile2.txt &&
|
test_cmp B/newfile2.txt ../B/newfile2.txt &&
|
||||||
test_cmp C/newfile3.png ../C/newfile3.png &&
|
test_cmp C/newfile3.png ../C/newfile3.png &&
|
||||||
test_cmp D/newfile4.png ../D/newfile4.png
|
test_cmp D/newfile4.png ../D/newfile4.png
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'Remove two files, add two and update two' '
|
||||||
'Remove two files, add two and update two' \
|
echo Hello1 >>A/newfile1.txt &&
|
||||||
'echo Hello1 >>A/newfile1.txt &&
|
|
||||||
rm -f B/newfile2.txt &&
|
rm -f B/newfile2.txt &&
|
||||||
rm -f C/newfile3.png &&
|
rm -f C/newfile3.png &&
|
||||||
echo Hello5 >E/newfile5.txt &&
|
echo Hello5 >E/newfile5.txt &&
|
||||||
@ -99,7 +98,8 @@ test_expect_success \
|
|||||||
test_cmp D/newfile4.png ../D/newfile4.png &&
|
test_cmp D/newfile4.png ../D/newfile4.png &&
|
||||||
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
||||||
test_cmp F/newfile6.png ../F/newfile6.png
|
test_cmp F/newfile6.png ../F/newfile6.png
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
# Should fail (but only on the git cvsexportcommit stage)
|
# Should fail (but only on the git cvsexportcommit stage)
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
@ -129,9 +129,8 @@ test_expect_success \
|
|||||||
|
|
||||||
# This test is here because a patch for only binary files will
|
# This test is here because a patch for only binary files will
|
||||||
# fail with gnu patch, so cvsexportcommit must handle that.
|
# fail with gnu patch, so cvsexportcommit must handle that.
|
||||||
test_expect_success \
|
test_expect_success 'Remove only binary files' '
|
||||||
'Remove only binary files' \
|
git reset --hard HEAD^^ &&
|
||||||
'git reset --hard HEAD^^ &&
|
|
||||||
rm -f D/newfile4.png &&
|
rm -f D/newfile4.png &&
|
||||||
git commit -a -m "test: remove only a binary file" &&
|
git commit -a -m "test: remove only a binary file" &&
|
||||||
id=$(git rev-list --max-count=1 HEAD) &&
|
id=$(git rev-list --max-count=1 HEAD) &&
|
||||||
@ -146,11 +145,11 @@ test_expect_success \
|
|||||||
test_cmp A/newfile1.txt ../A/newfile1.txt &&
|
test_cmp A/newfile1.txt ../A/newfile1.txt &&
|
||||||
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
||||||
test_cmp F/newfile6.png ../F/newfile6.png
|
test_cmp F/newfile6.png ../F/newfile6.png
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'Remove only a text file' '
|
||||||
'Remove only a text file' \
|
rm -f A/newfile1.txt &&
|
||||||
'rm -f A/newfile1.txt &&
|
|
||||||
git commit -a -m "test: remove only a binary file" &&
|
git commit -a -m "test: remove only a binary file" &&
|
||||||
id=$(git rev-list --max-count=1 HEAD) &&
|
id=$(git rev-list --max-count=1 HEAD) &&
|
||||||
(cd "$CVSWORK" &&
|
(cd "$CVSWORK" &&
|
||||||
@ -163,11 +162,11 @@ test_expect_success \
|
|||||||
check_entries F "newfile6.png/1.1/-kb" &&
|
check_entries F "newfile6.png/1.1/-kb" &&
|
||||||
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
||||||
test_cmp F/newfile6.png ../F/newfile6.png
|
test_cmp F/newfile6.png ../F/newfile6.png
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'New file with spaces in file name' '
|
||||||
'New file with spaces in file name' \
|
mkdir "G g" &&
|
||||||
'mkdir "G g" &&
|
|
||||||
echo ok then >"G g/with spaces.txt" &&
|
echo ok then >"G g/with spaces.txt" &&
|
||||||
git add "G g/with spaces.txt" && \
|
git add "G g/with spaces.txt" && \
|
||||||
cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
|
cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
|
||||||
@ -177,11 +176,11 @@ test_expect_success \
|
|||||||
(cd "$CVSWORK" &&
|
(cd "$CVSWORK" &&
|
||||||
git cvsexportcommit -c $id &&
|
git cvsexportcommit -c $id &&
|
||||||
check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
|
check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'Update file with spaces in file name' '
|
||||||
'Update file with spaces in file name' \
|
echo Ok then >>"G g/with spaces.txt" &&
|
||||||
'echo Ok then >>"G g/with spaces.txt" &&
|
|
||||||
cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
|
cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
|
||||||
git add "G g/with spaces.png" &&
|
git add "G g/with spaces.png" &&
|
||||||
git commit -a -m "Update with spaces" &&
|
git commit -a -m "Update with spaces" &&
|
||||||
@ -189,7 +188,8 @@ test_expect_success \
|
|||||||
(cd "$CVSWORK" &&
|
(cd "$CVSWORK" &&
|
||||||
git cvsexportcommit -c $id &&
|
git cvsexportcommit -c $id &&
|
||||||
check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
|
check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
# Some filesystems mangle pathnames with UTF-8 characters --
|
# Some filesystems mangle pathnames with UTF-8 characters --
|
||||||
# check and skip
|
# check and skip
|
||||||
@ -202,9 +202,8 @@ if p="Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" &&
|
|||||||
then
|
then
|
||||||
|
|
||||||
# This test contains UTF-8 characters
|
# This test contains UTF-8 characters
|
||||||
test_expect_success !MINGW \
|
test_expect_success !MINGW 'File with non-ascii file name' '
|
||||||
'File with non-ascii file name' \
|
mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
|
||||||
'mkdir -p Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö &&
|
|
||||||
echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
|
echo Foo >Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
|
||||||
git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
|
git add Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.txt &&
|
||||||
cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
|
cp "$TEST_DIRECTORY"/test-binary-1.png Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö/gårdetsågårdet.png &&
|
||||||
@ -216,15 +215,15 @@ test_expect_success !MINGW \
|
|||||||
check_entries \
|
check_entries \
|
||||||
"Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
|
"Å/goo/a/b/c/d/e/f/g/h/i/j/k/l/m/n/o/p/q/r/s/t/u/v/w/x/y/z/å/ä/ö" \
|
||||||
"gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
|
"gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
rm -fr tst
|
rm -fr tst
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success 'Mismatching patch should fail' '
|
||||||
'Mismatching patch should fail' \
|
date >>"E/newfile5.txt" &&
|
||||||
'date >>"E/newfile5.txt" &&
|
|
||||||
git add "E/newfile5.txt" &&
|
git add "E/newfile5.txt" &&
|
||||||
git commit -a -m "Update one" &&
|
git commit -a -m "Update one" &&
|
||||||
date >>"E/newfile5.txt" &&
|
date >>"E/newfile5.txt" &&
|
||||||
@ -233,11 +232,11 @@ test_expect_success \
|
|||||||
id=$(git rev-list --max-count=1 HEAD) &&
|
id=$(git rev-list --max-count=1 HEAD) &&
|
||||||
(cd "$CVSWORK" &&
|
(cd "$CVSWORK" &&
|
||||||
test_must_fail git cvsexportcommit -c $id
|
test_must_fail git cvsexportcommit -c $id
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success FILEMODE \
|
test_expect_success FILEMODE 'Retain execute bit' '
|
||||||
'Retain execute bit' \
|
mkdir G &&
|
||||||
'mkdir G &&
|
|
||||||
echo executeon >G/on &&
|
echo executeon >G/on &&
|
||||||
chmod +x G/on &&
|
chmod +x G/on &&
|
||||||
echo executeoff >G/off &&
|
echo executeoff >G/off &&
|
||||||
@ -248,7 +247,8 @@ test_expect_success FILEMODE \
|
|||||||
git cvsexportcommit -c HEAD &&
|
git cvsexportcommit -c HEAD &&
|
||||||
test -x G/on &&
|
test -x G/on &&
|
||||||
! test -x G/off
|
! test -x G/off
|
||||||
)'
|
)
|
||||||
|
'
|
||||||
|
|
||||||
test_expect_success '-w option should work with relative GIT_DIR' '
|
test_expect_success '-w option should work with relative GIT_DIR' '
|
||||||
mkdir W &&
|
mkdir W &&
|
||||||
@ -290,7 +290,6 @@ test_expect_success 'check files before directories' '
|
|||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 're-commit a removed filename which remains in CVS attic' '
|
test_expect_success 're-commit a removed filename which remains in CVS attic' '
|
||||||
|
|
||||||
(cd "$CVSWORK" &&
|
(cd "$CVSWORK" &&
|
||||||
echo >attic_gremlin &&
|
echo >attic_gremlin &&
|
||||||
cvs -Q add attic_gremlin &&
|
cvs -Q add attic_gremlin &&
|
||||||
|
Reference in New Issue
Block a user