2007-01-16 01:31:49 +00:00
|
|
|
#!/bin/sh
|
2006-11-12 15:29:42 +00:00
|
|
|
#
|
|
|
|
# Copyright (c) Robin Rosenberg
|
|
|
|
#
|
2008-02-13 03:11:22 +00:00
|
|
|
test_description='Test export of commits to CVS'
|
2006-11-12 15:29:42 +00:00
|
|
|
|
|
|
|
. ./test-lib.sh
|
|
|
|
|
2009-04-03 19:33:59 +00:00
|
|
|
if ! test_have_prereq PERL; then
|
2010-06-24 17:44:48 +00:00
|
|
|
skip_all='skipping git cvsexportcommit tests, perl not available'
|
2009-04-03 19:33:59 +00:00
|
|
|
test_done
|
|
|
|
fi
|
|
|
|
|
2006-11-12 15:29:42 +00:00
|
|
|
cvs >/dev/null 2>&1
|
|
|
|
if test $? -ne 1
|
|
|
|
then
|
2010-06-24 17:44:48 +00:00
|
|
|
skip_all='skipping git cvsexportcommit tests, cvs not found'
|
2006-11-12 15:29:42 +00:00
|
|
|
test_done
|
|
|
|
fi
|
|
|
|
|
2017-02-27 11:26:28 +00:00
|
|
|
if ! test_have_prereq NOT_ROOT; then
|
|
|
|
skip_all='When cvs is compiled with CVS_BADROOT commits as root fail'
|
|
|
|
test_done
|
|
|
|
fi
|
|
|
|
|
2012-10-26 16:18:24 +00:00
|
|
|
CVSROOT=$PWD/tmpcvsroot
|
2012-01-11 09:20:14 +00:00
|
|
|
CVSWORK=$PWD/cvswork
|
|
|
|
GIT_DIR=$PWD/.git
|
2006-12-28 09:10:52 +00:00
|
|
|
export CVSROOT CVSWORK GIT_DIR
|
|
|
|
|
2006-11-12 15:29:42 +00:00
|
|
|
rm -rf "$CVSROOT" "$CVSWORK"
|
2012-12-25 01:09:49 +00:00
|
|
|
|
2006-11-12 15:29:42 +00:00
|
|
|
cvs init &&
|
2012-12-25 01:09:49 +00:00
|
|
|
test -d "$CVSROOT" &&
|
2006-11-12 15:29:42 +00:00
|
|
|
cvs -Q co -d "$CVSWORK" . &&
|
|
|
|
echo >empty &&
|
|
|
|
git add empty &&
|
2006-12-28 09:10:52 +00:00
|
|
|
git commit -q -a -m "Initial" 2>/dev/null ||
|
2006-11-12 15:29:42 +00:00
|
|
|
exit 1
|
|
|
|
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries () {
|
|
|
|
# $1 == directory, $2 == expected
|
2016-02-21 17:32:22 +00:00
|
|
|
sed -ne '/^\//p' "$1/CVS/Entries" | sort | cut -d/ -f2,3,5 >actual
|
2007-07-25 06:25:38 +00:00
|
|
|
if test -z "$2"
|
|
|
|
then
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 21:57:25 +00:00
|
|
|
test_must_be_empty actual
|
2007-07-25 06:25:38 +00:00
|
|
|
else
|
|
|
|
printf '%s\n' "$2" | tr '|' '\012' >expected
|
tests: use 'test_must_be_empty' instead of 'test_cmp <empty> <out>'
Using 'test_must_be_empty' is shorter and more idiomatic than
>empty &&
test_cmp empty out
as it saves the creation of an empty file. Furthermore, sometimes the
expected empty file doesn't have such a descriptive name like 'empty',
and its creation is far away from the place where it's finally used
for comparison (e.g. in 't7600-merge.sh', where two expected empty
files are created in the 'setup' test, but are used only about 500
lines later).
These cases were found by instrumenting 'test_cmp' to error out the
test script when it's used to compare empty files, and then converted
manually.
Note that even after this patch there still remain a lot of cases
where we use 'test_cmp' to check empty files:
- Sometimes the expected output is not hard-coded in the test, but
'test_cmp' is used to ensure that two similar git commands produce
the same output, and that output happens to be empty, e.g. the
test 'submodule update --merge - ignores --merge for new
submodules' in 't7406-submodule-update.sh'.
- Repetitive common tasks, including preparing the expected results
and running 'test_cmp', are often extracted into a helper
function, and some of this helper's callsites expect no output.
- For the same reason as above, the whole 'test_expect_success'
block is within a helper function, e.g. in 't3070-wildmatch.sh'.
- Or 'test_cmp' is invoked in a loop, e.g. the test 'cvs update
(-p)' in 't9400-git-cvsserver-server.sh'.
Signed-off-by: SZEDER Gábor <szeder.dev@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2018-08-19 21:57:25 +00:00
|
|
|
test_cmp expected actual
|
2007-07-25 06:25:38 +00:00
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2006-11-12 15:29:42 +00:00
|
|
|
test_expect_success \
|
|
|
|
'New file' \
|
|
|
|
'mkdir A B C D E F &&
|
|
|
|
echo hello1 >A/newfile1.txt &&
|
|
|
|
echo hello2 >B/newfile2.txt &&
|
2011-07-19 17:21:47 +00:00
|
|
|
cp "$TEST_DIRECTORY"/test-binary-1.png C/newfile3.png &&
|
|
|
|
cp "$TEST_DIRECTORY"/test-binary-1.png D/newfile4.png &&
|
2006-11-12 15:29:42 +00:00
|
|
|
git add A/newfile1.txt &&
|
|
|
|
git add B/newfile2.txt &&
|
|
|
|
git add C/newfile3.png &&
|
|
|
|
git add D/newfile4.png &&
|
|
|
|
git commit -a -m "Test: New file" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries A "newfile1.txt/1.1/" &&
|
|
|
|
check_entries B "newfile2.txt/1.1/" &&
|
|
|
|
check_entries C "newfile3.png/1.1/-kb" &&
|
|
|
|
check_entries D "newfile4.png/1.1/-kb" &&
|
2010-05-14 09:31:37 +00:00
|
|
|
test_cmp A/newfile1.txt ../A/newfile1.txt &&
|
|
|
|
test_cmp B/newfile2.txt ../B/newfile2.txt &&
|
|
|
|
test_cmp C/newfile3.png ../C/newfile3.png &&
|
|
|
|
test_cmp D/newfile4.png ../D/newfile4.png
|
2006-11-12 15:29:42 +00:00
|
|
|
)'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'Remove two files, add two and update two' \
|
|
|
|
'echo Hello1 >>A/newfile1.txt &&
|
|
|
|
rm -f B/newfile2.txt &&
|
|
|
|
rm -f C/newfile3.png &&
|
|
|
|
echo Hello5 >E/newfile5.txt &&
|
2011-07-19 17:21:47 +00:00
|
|
|
cp "$TEST_DIRECTORY"/test-binary-2.png D/newfile4.png &&
|
|
|
|
cp "$TEST_DIRECTORY"/test-binary-1.png F/newfile6.png &&
|
2006-11-12 15:29:42 +00:00
|
|
|
git add E/newfile5.txt &&
|
|
|
|
git add F/newfile6.png &&
|
|
|
|
git commit -a -m "Test: Remove, add and update" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries A "newfile1.txt/1.2/" &&
|
|
|
|
check_entries B "" &&
|
|
|
|
check_entries C "" &&
|
|
|
|
check_entries D "newfile4.png/1.2/-kb" &&
|
|
|
|
check_entries E "newfile5.txt/1.1/" &&
|
|
|
|
check_entries F "newfile6.png/1.1/-kb" &&
|
2010-05-14 09:31:37 +00:00
|
|
|
test_cmp A/newfile1.txt ../A/newfile1.txt &&
|
|
|
|
test_cmp D/newfile4.png ../D/newfile4.png &&
|
|
|
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
|
|
|
test_cmp F/newfile6.png ../F/newfile6.png
|
2006-11-12 15:29:42 +00:00
|
|
|
)'
|
|
|
|
|
2008-09-09 21:25:24 +00:00
|
|
|
# Should fail (but only on the git cvsexportcommit stage)
|
2006-11-12 15:29:42 +00:00
|
|
|
test_expect_success \
|
|
|
|
'Fail to change binary more than one generation old' \
|
|
|
|
'cat F/newfile6.png >>D/newfile4.png &&
|
|
|
|
git commit -a -m "generatiion 1" &&
|
|
|
|
cat F/newfile6.png >>D/newfile4.png &&
|
|
|
|
git commit -a -m "generation 2" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
2008-07-12 15:47:52 +00:00
|
|
|
test_must_fail git cvsexportcommit -c $id
|
2006-11-12 15:29:42 +00:00
|
|
|
)'
|
|
|
|
|
2006-12-10 23:30:06 +00:00
|
|
|
#test_expect_success \
|
|
|
|
# 'Fail to remove binary file more than one generation old' \
|
|
|
|
# 'git reset --hard HEAD^ &&
|
|
|
|
# cat F/newfile6.png >>D/newfile4.png &&
|
|
|
|
# git commit -a -m "generation 2 (again)" &&
|
|
|
|
# rm -f D/newfile4.png &&
|
|
|
|
# git commit -a -m "generation 3" &&
|
|
|
|
# id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
# (cd "$CVSWORK" &&
|
2008-07-12 15:47:52 +00:00
|
|
|
# test_must_fail git cvsexportcommit -c $id
|
2006-12-10 23:30:06 +00:00
|
|
|
# )'
|
2006-11-12 15:29:42 +00:00
|
|
|
|
|
|
|
# We reuse the state from two tests back here
|
|
|
|
|
|
|
|
# This test is here because a patch for only binary files will
|
|
|
|
# fail with gnu patch, so cvsexportcommit must handle that.
|
|
|
|
test_expect_success \
|
|
|
|
'Remove only binary files' \
|
2006-12-10 23:30:06 +00:00
|
|
|
'git reset --hard HEAD^^ &&
|
2006-11-12 15:29:42 +00:00
|
|
|
rm -f D/newfile4.png &&
|
|
|
|
git commit -a -m "test: remove only a binary file" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries A "newfile1.txt/1.2/" &&
|
|
|
|
check_entries B "" &&
|
|
|
|
check_entries C "" &&
|
|
|
|
check_entries D "" &&
|
|
|
|
check_entries E "newfile5.txt/1.1/" &&
|
|
|
|
check_entries F "newfile6.png/1.1/-kb" &&
|
2010-05-14 09:31:37 +00:00
|
|
|
test_cmp A/newfile1.txt ../A/newfile1.txt &&
|
|
|
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
|
|
|
test_cmp F/newfile6.png ../F/newfile6.png
|
2006-11-12 15:29:42 +00:00
|
|
|
)'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'Remove only a text file' \
|
|
|
|
'rm -f A/newfile1.txt &&
|
|
|
|
git commit -a -m "test: remove only a binary file" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries A "" &&
|
|
|
|
check_entries B "" &&
|
|
|
|
check_entries C "" &&
|
|
|
|
check_entries D "" &&
|
|
|
|
check_entries E "newfile5.txt/1.1/" &&
|
|
|
|
check_entries F "newfile6.png/1.1/-kb" &&
|
2010-05-14 09:31:37 +00:00
|
|
|
test_cmp E/newfile5.txt ../E/newfile5.txt &&
|
|
|
|
test_cmp F/newfile6.png ../F/newfile6.png
|
2006-11-12 15:29:42 +00:00
|
|
|
)'
|
|
|
|
|
2006-12-10 23:30:06 +00:00
|
|
|
test_expect_success \
|
|
|
|
'New file with spaces in file name' \
|
|
|
|
'mkdir "G g" &&
|
|
|
|
echo ok then >"G g/with spaces.txt" &&
|
|
|
|
git add "G g/with spaces.txt" && \
|
2011-07-19 17:21:47 +00:00
|
|
|
cp "$TEST_DIRECTORY"/test-binary-1.png "G g/with spaces.png" && \
|
2006-12-10 23:30:06 +00:00
|
|
|
git add "G g/with spaces.png" &&
|
|
|
|
git commit -a -m "With spaces" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
2008-09-09 21:25:24 +00:00
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries "G g" "with spaces.png/1.1/-kb|with spaces.txt/1.1/"
|
2006-12-10 23:30:06 +00:00
|
|
|
)'
|
|
|
|
|
|
|
|
test_expect_success \
|
|
|
|
'Update file with spaces in file name' \
|
|
|
|
'echo Ok then >>"G g/with spaces.txt" &&
|
2011-07-19 17:21:47 +00:00
|
|
|
cat "$TEST_DIRECTORY"/test-binary-1.png >>"G g/with spaces.png" && \
|
2006-12-10 23:30:06 +00:00
|
|
|
git add "G g/with spaces.png" &&
|
|
|
|
git commit -a -m "Update with spaces" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
2018-07-02 00:24:04 +00:00
|
|
|
git cvsexportcommit -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
check_entries "G g" "with spaces.png/1.2/-kb|with spaces.txt/1.2/"
|
2006-12-10 23:30:06 +00:00
|
|
|
)'
|
|
|
|
|
2007-02-05 01:30:58 +00:00
|
|
|
# Some filesystems mangle pathnames with UTF-8 characters --
|
|
|
|
# check and skip
|
|
|
|
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/å/ä/ö" &&
|
|
|
|
mkdir -p "tst/$p" &&
|
|
|
|
date >"tst/$p/day" &&
|
|
|
|
found=$(find tst -type f -print) &&
|
|
|
|
test "z$found" = "ztst/$p/day" &&
|
|
|
|
rm -fr tst
|
|
|
|
then
|
|
|
|
|
2007-01-31 22:21:48 +00:00
|
|
|
# This test contains UTF-8 characters
|
mingw: do not bother to test funny file names
MSYS2 actually allows to create files or directories whose names contain
tabs, newlines or colors, even if plain Win32 API cannot access them.
As we are using an MSYS2 bash to run the tests, such files or
directories are created successfully, but Git itself has no chance to
work with them because it is a regular Windows program, hence limited by
the Win32 API.
With this change, on Windows otherwise failing tests in
t3300-funny-names.sh, t3600-rm.sh, t3703-add-magic-pathspec.sh,
t3902-quoted.sh, t4016-diff-quote.sh, t4135-apply-weird-filenames.sh,
t9200-git-cvsexportcommit.sh, and t9903-bash-prompt.sh are skipped.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-27 16:20:26 +00:00
|
|
|
test_expect_success !MINGW \
|
2006-12-10 23:30:06 +00:00
|
|
|
'File with non-ascii file name' \
|
2007-01-31 22:21:48 +00:00
|
|
|
'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 &&
|
|
|
|
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 &&
|
2011-07-19 17:21:47 +00:00
|
|
|
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 &&
|
2007-01-31 22:21:48 +00:00
|
|
|
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.png &&
|
|
|
|
git commit -a -m "Går det så går det" && \
|
2006-12-10 23:30:06 +00:00
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
2008-09-09 21:25:24 +00:00
|
|
|
git cvsexportcommit -v -c $id &&
|
2007-07-25 06:25:38 +00:00
|
|
|
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/å/ä/ö" \
|
|
|
|
"gårdetsågårdet.png/1.1/-kb|gårdetsågårdet.txt/1.1/"
|
2006-12-10 23:30:06 +00:00
|
|
|
)'
|
|
|
|
|
2007-02-05 01:30:58 +00:00
|
|
|
fi
|
|
|
|
|
|
|
|
rm -fr tst
|
|
|
|
|
2006-12-10 23:30:06 +00:00
|
|
|
test_expect_success \
|
|
|
|
'Mismatching patch should fail' \
|
|
|
|
'date >>"E/newfile5.txt" &&
|
|
|
|
git add "E/newfile5.txt" &&
|
|
|
|
git commit -a -m "Update one" &&
|
|
|
|
date >>"E/newfile5.txt" &&
|
|
|
|
git add "E/newfile5.txt" &&
|
|
|
|
git commit -a -m "Update two" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$CVSWORK" &&
|
2008-09-09 21:25:24 +00:00
|
|
|
test_must_fail git cvsexportcommit -c $id
|
2006-12-10 23:30:06 +00:00
|
|
|
)'
|
|
|
|
|
2009-02-27 21:20:57 +00:00
|
|
|
test_expect_success FILEMODE \
|
2006-12-10 23:30:06 +00:00
|
|
|
'Retain execute bit' \
|
|
|
|
'mkdir G &&
|
|
|
|
echo executeon >G/on &&
|
|
|
|
chmod +x G/on &&
|
|
|
|
echo executeoff >G/off &&
|
|
|
|
git add G/on &&
|
|
|
|
git add G/off &&
|
|
|
|
git commit -a -m "Execute test" &&
|
|
|
|
(cd "$CVSWORK" &&
|
2018-07-02 00:24:04 +00:00
|
|
|
git cvsexportcommit -c HEAD &&
|
2006-12-10 23:30:06 +00:00
|
|
|
test -x G/on &&
|
|
|
|
! test -x G/off
|
|
|
|
)'
|
2006-12-04 07:44:08 +00:00
|
|
|
|
2008-02-11 23:43:41 +00:00
|
|
|
test_expect_success '-w option should work with relative GIT_DIR' '
|
2008-02-13 03:11:22 +00:00
|
|
|
mkdir W &&
|
|
|
|
echo foobar >W/file1.txt &&
|
|
|
|
echo bazzle >W/file2.txt &&
|
|
|
|
git add W/file1.txt &&
|
|
|
|
git add W/file2.txt &&
|
|
|
|
git commit -m "More updates" &&
|
|
|
|
id=$(git rev-list --max-count=1 HEAD) &&
|
|
|
|
(cd "$GIT_DIR" &&
|
|
|
|
GIT_DIR=. git cvsexportcommit -w "$CVSWORK" -c $id &&
|
|
|
|
check_entries "$CVSWORK/W" "file1.txt/1.1/|file2.txt/1.1/" &&
|
2008-03-12 21:36:36 +00:00
|
|
|
test_cmp "$CVSWORK/W/file1.txt" ../W/file1.txt &&
|
|
|
|
test_cmp "$CVSWORK/W/file2.txt" ../W/file2.txt
|
2008-02-13 03:11:22 +00:00
|
|
|
)
|
|
|
|
'
|
|
|
|
|
2008-02-18 17:55:22 +00:00
|
|
|
test_expect_success 'check files before directories' '
|
|
|
|
|
|
|
|
echo Notes > release-notes &&
|
|
|
|
git add release-notes &&
|
|
|
|
git commit -m "Add release notes" release-notes &&
|
|
|
|
id=$(git rev-parse HEAD) &&
|
|
|
|
git cvsexportcommit -w "$CVSWORK" -c $id &&
|
|
|
|
|
|
|
|
echo new > DS &&
|
|
|
|
echo new > E/DS &&
|
|
|
|
echo modified > release-notes &&
|
|
|
|
git add DS E/DS release-notes &&
|
|
|
|
git commit -m "Add two files with the same basename" &&
|
|
|
|
id=$(git rev-parse HEAD) &&
|
|
|
|
git cvsexportcommit -w "$CVSWORK" -c $id &&
|
|
|
|
check_entries "$CVSWORK/E" "DS/1.1/|newfile5.txt/1.1/" &&
|
|
|
|
check_entries "$CVSWORK" "DS/1.1/|release-notes/1.2/" &&
|
2008-03-12 21:36:36 +00:00
|
|
|
test_cmp "$CVSWORK/DS" DS &&
|
|
|
|
test_cmp "$CVSWORK/E/DS" E/DS &&
|
|
|
|
test_cmp "$CVSWORK/release-notes" release-notes
|
2008-02-18 17:55:22 +00:00
|
|
|
|
|
|
|
'
|
|
|
|
|
2009-07-15 14:34:24 +00:00
|
|
|
test_expect_success 're-commit a removed filename which remains in CVS attic' '
|
|
|
|
|
|
|
|
(cd "$CVSWORK" &&
|
|
|
|
echo >attic_gremlin &&
|
|
|
|
cvs -Q add attic_gremlin &&
|
|
|
|
cvs -Q ci -m "added attic_gremlin" &&
|
|
|
|
rm attic_gremlin &&
|
|
|
|
cvs -Q rm attic_gremlin &&
|
|
|
|
cvs -Q ci -m "removed attic_gremlin") &&
|
|
|
|
|
|
|
|
echo > attic_gremlin &&
|
|
|
|
git add attic_gremlin &&
|
|
|
|
git commit -m "Added attic_gremlin" &&
|
|
|
|
git cvsexportcommit -w "$CVSWORK" -c HEAD &&
|
2018-07-02 00:24:04 +00:00
|
|
|
(cd "$CVSWORK" && cvs -Q update -d) &&
|
2009-07-15 14:34:24 +00:00
|
|
|
test -f "$CVSWORK/attic_gremlin"
|
|
|
|
'
|
|
|
|
|
|
|
|
# the state of the CVS sandbox may be indeterminate for ' space'
|
|
|
|
# after this test on some platforms / with some versions of CVS
|
|
|
|
# consider adding new tests above this point
|
2008-02-18 17:55:22 +00:00
|
|
|
test_expect_success 'commit a file with leading spaces in the name' '
|
|
|
|
|
|
|
|
echo space > " space" &&
|
|
|
|
git add " space" &&
|
|
|
|
git commit -m "Add a file with a leading space" &&
|
|
|
|
id=$(git rev-parse HEAD) &&
|
|
|
|
git cvsexportcommit -w "$CVSWORK" -c $id &&
|
2009-07-15 14:34:24 +00:00
|
|
|
check_entries "$CVSWORK" " space/1.1/|DS/1.1/|attic_gremlin/1.3/|release-notes/1.2/" &&
|
2008-03-12 21:36:36 +00:00
|
|
|
test_cmp "$CVSWORK/ space" " space"
|
2008-02-18 17:55:22 +00:00
|
|
|
|
|
|
|
'
|
|
|
|
|
2008-05-14 14:29:49 +00:00
|
|
|
test_expect_success 'use the same checkout for Git and CVS' '
|
|
|
|
|
|
|
|
(mkdir shared &&
|
|
|
|
cd shared &&
|
2012-02-12 01:05:12 +00:00
|
|
|
sane_unset GIT_DIR &&
|
2008-05-14 14:29:49 +00:00
|
|
|
cvs co . &&
|
|
|
|
git init &&
|
|
|
|
git add " space" &&
|
|
|
|
git commit -m "fake initial commit" &&
|
|
|
|
echo Hello >> " space" &&
|
|
|
|
git commit -m "Another change" " space" &&
|
|
|
|
git cvsexportcommit -W -p -u -c HEAD &&
|
|
|
|
grep Hello " space" &&
|
|
|
|
git diff-files)
|
|
|
|
|
|
|
|
'
|
|
|
|
|
2006-11-12 15:29:42 +00:00
|
|
|
test_done
|