2008-05-15 06:35:47 +02:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# Copyright (c) 2008 Matthew Ogilvie
|
|
|
|
# Parts adapted from other tests.
|
|
|
|
#
|
|
|
|
|
|
|
|
test_description='git-cvsserver -kb modes
|
|
|
|
|
|
|
|
tests -kb mode for binary files when accessing a git
|
|
|
|
repository using cvs CLI client via git-cvsserver server'
|
|
|
|
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
|
tests: mark tests relying on the current default for `init.defaultBranch`
In addition to the manual adjustment to let the `linux-gcc` CI job run
the test suite with `master` and then with `main`, this patch makes sure
that GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME is set in all test scripts
that currently rely on the initial branch name being `master by default.
To determine which test scripts to mark up, the first step was to
force-set the default branch name to `master` in
- all test scripts that contain the keyword `master`,
- t4211, which expects `t/t4211/history.export` with a hard-coded ref to
initialize the default branch,
- t5560 because it sources `t/t556x_common` which uses `master`,
- t8002 and t8012 because both source `t/annotate-tests.sh` which also
uses `master`)
This trick was performed by this command:
$ sed -i '/^ *\. \.\/\(test-lib\|lib-\(bash\|cvs\|git-svn\)\|gitweb-lib\)\.sh$/i\
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
' $(git grep -l master t/t[0-9]*.sh) \
t/t4211*.sh t/t5560*.sh t/t8002*.sh t/t8012*.sh
After that, careful, manual inspection revealed that some of the test
scripts containing the needle `master` do not actually rely on a
specific default branch name: either they mention `master` only in a
comment, or they initialize that branch specificially, or they do not
actually refer to the current default branch. Therefore, the
aforementioned modification was undone in those test scripts thusly:
$ git checkout HEAD -- \
t/t0027-auto-crlf.sh t/t0060-path-utils.sh \
t/t1011-read-tree-sparse-checkout.sh \
t/t1305-config-include.sh t/t1309-early-config.sh \
t/t1402-check-ref-format.sh t/t1450-fsck.sh \
t/t2024-checkout-dwim.sh \
t/t2106-update-index-assume-unchanged.sh \
t/t3040-subprojects-basic.sh t/t3301-notes.sh \
t/t3308-notes-merge.sh t/t3423-rebase-reword.sh \
t/t3436-rebase-more-options.sh \
t/t4015-diff-whitespace.sh t/t4257-am-interactive.sh \
t/t5323-pack-redundant.sh t/t5401-update-hooks.sh \
t/t5511-refspec.sh t/t5526-fetch-submodules.sh \
t/t5529-push-errors.sh t/t5530-upload-pack-error.sh \
t/t5548-push-porcelain.sh \
t/t5552-skipping-fetch-negotiator.sh \
t/t5572-pull-submodule.sh t/t5608-clone-2gb.sh \
t/t5614-clone-submodules-shallow.sh \
t/t7508-status.sh t/t7606-merge-custom.sh \
t/t9302-fast-import-unpack-limit.sh
We excluded one set of test scripts in these commands, though: the range
of `git p4` tests. The reason? `git p4` stores the (foreign) remote
branch in the branch called `p4/master`, which is obviously not the
default branch. Manual analysis revealed that only five of these tests
actually require a specific default branch name to pass; They were
modified thusly:
$ sed -i '/^ *\. \.\/lib-git-p4\.sh$/i\
GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=master\
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME\
' t/t980[0167]*.sh t/t9811*.sh
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-11-19 00:44:19 +01:00
|
|
|
export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
|
|
|
|
|
2008-05-15 06:35:47 +02:00
|
|
|
. ./test-lib.sh
|
|
|
|
|
|
|
|
marked_as () {
|
|
|
|
foundEntry="$(grep "^/$2/" "$1/CVS/Entries")"
|
|
|
|
if [ x"$foundEntry" = x"" ] ; then
|
|
|
|
echo "NOT FOUND: $1 $2 1 $3" >> "${WORKDIR}/marked.log"
|
|
|
|
return 1
|
|
|
|
fi
|
|
|
|
test x"$(grep "^/$2/" "$1/CVS/Entries" | cut -d/ -f5)" = x"$3"
|
|
|
|
stat=$?
|
|
|
|
echo "$1 $2 $stat '$3'" >> "${WORKDIR}/marked.log"
|
|
|
|
return $stat
|
|
|
|
}
|
|
|
|
|
|
|
|
not_present() {
|
|
|
|
foundEntry="$(grep "^/$2/" "$1/CVS/Entries")"
|
|
|
|
if [ -r "$1/$2" ] ; then
|
|
|
|
echo "Error: File still exists: $1 $2" >> "${WORKDIR}/marked.log"
|
|
|
|
return 1;
|
|
|
|
fi
|
|
|
|
if [ x"$foundEntry" != x"" ] ; then
|
|
|
|
echo "Error: should not have found: $1 $2" >> "${WORKDIR}/marked.log"
|
|
|
|
return 1;
|
|
|
|
else
|
|
|
|
echo "Correctly not found: $1 $2" >> "${WORKDIR}/marked.log"
|
|
|
|
return 0;
|
|
|
|
fi
|
|
|
|
}
|
|
|
|
|
2012-10-14 07:42:23 +02:00
|
|
|
check_status_options() {
|
|
|
|
(cd "$1" &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q status "$2" > "${WORKDIR}/status.out" 2>&1
|
|
|
|
)
|
|
|
|
if [ x"$?" != x"0" ] ; then
|
|
|
|
echo "Error from cvs status: $1 $2" >> "${WORKDIR}/marked.log"
|
|
|
|
return 1;
|
|
|
|
fi
|
2012-10-25 17:58:19 +02:00
|
|
|
got="$(sed -n -e 's/^[ ]*Sticky Options:[ ]*//p' "${WORKDIR}/status.out")"
|
2012-10-14 07:42:23 +02:00
|
|
|
expect="$3"
|
|
|
|
if [ x"$expect" = x"" ] ; then
|
|
|
|
expect="(none)"
|
|
|
|
fi
|
|
|
|
test x"$got" = x"$expect"
|
|
|
|
stat=$?
|
|
|
|
echo "cvs status: $1 $2 $stat '$3' '$got'" >> "${WORKDIR}/marked.log"
|
|
|
|
return $stat
|
|
|
|
}
|
|
|
|
|
2008-05-15 06:35:47 +02:00
|
|
|
cvs >/dev/null 2>&1
|
|
|
|
if test $? -ne 1
|
|
|
|
then
|
2010-06-24 19:44:48 +02:00
|
|
|
skip_all='skipping git-cvsserver tests, cvs not found'
|
2008-05-15 06:35:47 +02:00
|
|
|
test_done
|
|
|
|
fi
|
2009-04-03 21:33:59 +02:00
|
|
|
if ! test_have_prereq PERL
|
|
|
|
then
|
2010-06-24 19:44:48 +02:00
|
|
|
skip_all='skipping git-cvsserver tests, perl not available'
|
2009-04-03 21:33:59 +02:00
|
|
|
test_done
|
|
|
|
fi
|
2013-10-29 02:23:03 +01:00
|
|
|
perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || {
|
2010-06-24 19:44:48 +02:00
|
|
|
skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable'
|
2008-05-15 06:35:47 +02:00
|
|
|
test_done
|
|
|
|
}
|
|
|
|
|
|
|
|
unset GIT_DIR GIT_CONFIG
|
mingw: work around pwd issues in the tests
In Git for Windows' SDK, the tests are run using a Bash that relies on
the POSIX emulation layer MSYS2 (itself a friendly fork of Cygwin). As
such, paths in tests can be POSIX paths. As soon as those paths are
passed to git.exe (which does *not* use the POSIX emulation layer),
those paths are converted into Windows paths, though. This happens
for command-line parameters, but not when reading, say, config variables.
To help with that, the `pwd` command is overridden to return the Windows
path of the current working directory when testing Git on Windows.
However, when talking to anything using the POSIX emulation layer, it is
really much better to use POSIX paths because Windows paths contain a
colon after the drive letter that will easily be mistaken for the common
separator in path lists.
So let's just use the $PWD variable when the POSIX path is needed.
This lets t7800-difftool.sh, t9400-git-cvsserver-server.sh,
t9402-git-cvsserver-refs.sh and t9401-git-cvsserver-crlf.sh pass in Git
for Windows' SDK.
Note: the cvsserver tests require not only the `cvs` package (install
it into Git for Windows' SDK via `pacman -S cvs`) but also the Perl
SQLite bindings (install them into Git for Windows' SDK via
`cpan DBD::SQLite`).
This patch is based on earlier work by 마누엘 and Karsten Blees.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-27 17:19:59 +01:00
|
|
|
WORKDIR=$PWD
|
|
|
|
SERVERDIR=$PWD/gitcvs.git
|
2008-05-15 06:35:47 +02:00
|
|
|
git_config="$SERVERDIR/config"
|
|
|
|
CVSROOT=":fork:$SERVERDIR"
|
mingw: work around pwd issues in the tests
In Git for Windows' SDK, the tests are run using a Bash that relies on
the POSIX emulation layer MSYS2 (itself a friendly fork of Cygwin). As
such, paths in tests can be POSIX paths. As soon as those paths are
passed to git.exe (which does *not* use the POSIX emulation layer),
those paths are converted into Windows paths, though. This happens
for command-line parameters, but not when reading, say, config variables.
To help with that, the `pwd` command is overridden to return the Windows
path of the current working directory when testing Git on Windows.
However, when talking to anything using the POSIX emulation layer, it is
really much better to use POSIX paths because Windows paths contain a
colon after the drive letter that will easily be mistaken for the common
separator in path lists.
So let's just use the $PWD variable when the POSIX path is needed.
This lets t7800-difftool.sh, t9400-git-cvsserver-server.sh,
t9402-git-cvsserver-refs.sh and t9401-git-cvsserver-crlf.sh pass in Git
for Windows' SDK.
Note: the cvsserver tests require not only the `cvs` package (install
it into Git for Windows' SDK via `pacman -S cvs`) but also the Perl
SQLite bindings (install them into Git for Windows' SDK via
`cpan DBD::SQLite`).
This patch is based on earlier work by 마누엘 and Karsten Blees.
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2016-01-27 17:19:59 +01:00
|
|
|
CVSWORK="$PWD/cvswork"
|
2008-05-15 06:35:47 +02:00
|
|
|
CVS_SERVER=git-cvsserver
|
|
|
|
export CVSROOT CVS_SERVER
|
|
|
|
|
|
|
|
rm -rf "$CVSWORK" "$SERVERDIR"
|
|
|
|
test_expect_success 'setup' '
|
2013-01-05 01:24:32 +01:00
|
|
|
git config push.default matching &&
|
2008-05-15 06:35:47 +02:00
|
|
|
echo "Simple text file" >textfile.c &&
|
|
|
|
echo "File with embedded NUL: Q <- there" | q_to_nul > binfile.bin &&
|
|
|
|
mkdir subdir &&
|
|
|
|
echo "Another text file" > subdir/file.h &&
|
|
|
|
echo "Another binary: Q (this time CR)" | q_to_cr > subdir/withCr.bin &&
|
2010-10-31 02:46:54 +01:00
|
|
|
echo "Mixed up NUL, but marked text: Q <- there" | q_to_nul > mixedUp.c &&
|
2008-05-15 06:35:47 +02:00
|
|
|
echo "Unspecified" > subdir/unspecified.other &&
|
|
|
|
echo "/*.bin -crlf" > .gitattributes &&
|
|
|
|
echo "/*.c crlf" >> .gitattributes &&
|
|
|
|
echo "subdir/*.bin -crlf" >> .gitattributes &&
|
|
|
|
echo "subdir/*.c crlf" >> .gitattributes &&
|
|
|
|
echo "subdir/file.h crlf" >> .gitattributes &&
|
|
|
|
git add .gitattributes textfile.c binfile.bin mixedUp.c subdir/* &&
|
|
|
|
git commit -q -m "First Commit" &&
|
2009-03-07 00:04:09 +01:00
|
|
|
git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 &&
|
2008-05-15 06:35:47 +02:00
|
|
|
GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true &&
|
|
|
|
GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log"
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'cvs co (default crlf)' '
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:47 +02:00
|
|
|
test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x""
|
|
|
|
'
|
|
|
|
|
|
|
|
rm -rf cvswork
|
|
|
|
test_expect_success 'cvs co (allbinary)' '
|
|
|
|
GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true &&
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:47 +02:00
|
|
|
marked_as cvswork textfile.c -kb &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes -kb &&
|
|
|
|
marked_as cvswork mixedUp.c -kb &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h -kb &&
|
|
|
|
marked_as cvswork/subdir unspecified.other -kb
|
|
|
|
'
|
|
|
|
|
|
|
|
rm -rf cvswork cvs.log
|
|
|
|
test_expect_success 'cvs co (use attributes/allbinary)' '
|
|
|
|
GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true &&
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:47 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes -kb &&
|
|
|
|
marked_as cvswork mixedUp.c "" &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h "" &&
|
|
|
|
marked_as cvswork/subdir unspecified.other -kb
|
|
|
|
'
|
|
|
|
|
|
|
|
rm -rf cvswork
|
|
|
|
test_expect_success 'cvs co (use attributes)' '
|
|
|
|
GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false &&
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:47 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes "" &&
|
|
|
|
marked_as cvswork mixedUp.c "" &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h "" &&
|
|
|
|
marked_as cvswork/subdir unspecified.other ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'adding files' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
|
|
|
(cd subdir &&
|
2008-05-15 06:35:47 +02:00
|
|
|
echo "more text" > src.c &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 &&
|
|
|
|
marked_as . src.c "" &&
|
2016-08-09 10:53:38 +02:00
|
|
|
echo "pseudo-binary" > temp.bin
|
2010-09-06 20:39:54 +02:00
|
|
|
) &&
|
2008-05-15 06:35:47 +02:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 &&
|
|
|
|
marked_as subdir temp.bin "-kb" &&
|
|
|
|
cd subdir &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 &&
|
|
|
|
marked_as . temp.bin "-kb" &&
|
|
|
|
marked_as . src.c ""
|
2010-09-06 20:39:54 +02:00
|
|
|
)
|
2008-05-15 06:35:47 +02:00
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'updating' '
|
|
|
|
git pull gitcvs.git &&
|
t: don't spuriously close and reopen quotes
In the test scripts, the recommended style is, e.g.:
test_expect_success 'name' '
do-something somehow &&
do-some-more testing
'
When using this style, any single quote in the multi-line test section
is actually closing the lone single quotes that surround it.
It can be a non-issue in practice:
test_expect_success 'sed a little' '
sed -e 's/hi/lo/' in >out # "ok": no whitespace in s/hi/lo/
'
Or it can be a bug in the test, e.g., because variable interpolation
happens before the test even begins executing:
v=abc
test_expect_success 'variable interpolation' '
v=def &&
echo '"$v"' # abc
'
Change several such in-test single quotes to use double quotes instead
or, in a few cases, drop them altogether. These were identified using
some crude grepping. We're not fixing any test bugs here, but we're
hopefully making these tests slightly easier to grok and to maintain.
There are legitimate use cases for closing a quote and opening a new
one, e.g., both '\'' and '"'"' can be used to produce a literal single
quote. I'm not touching any of those here.
In t9401, tuck the redirecting ">" to the filename while we're touching
those lines.
Signed-off-by: Martin Ågren <martin.agren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
2020-08-06 22:08:53 +02:00
|
|
|
echo "hi" >subdir/newfile.bin &&
|
|
|
|
echo "junk" >subdir/file.h &&
|
|
|
|
echo "hi" >subdir/newfile.c &&
|
|
|
|
echo "hello" >>binfile.bin &&
|
2008-05-15 06:35:47 +02:00
|
|
|
git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin &&
|
|
|
|
git commit -q -m "Add and change some files" &&
|
|
|
|
git push gitcvs.git >/dev/null &&
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q update
|
|
|
|
) &&
|
2008-05-15 06:35:47 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes "" &&
|
|
|
|
marked_as cvswork mixedUp.c "" &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h "" &&
|
|
|
|
marked_as cvswork/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork/subdir newfile.bin -kb &&
|
|
|
|
marked_as cvswork/subdir newfile.c "" &&
|
|
|
|
echo "File with embedded NUL: Q <- there" | q_to_nul > tmpExpect1 &&
|
|
|
|
echo "hello" >> tmpExpect1 &&
|
|
|
|
cmp cvswork/binfile.bin tmpExpect1
|
|
|
|
'
|
|
|
|
|
2008-05-15 06:35:48 +02:00
|
|
|
rm -rf cvswork
|
|
|
|
test_expect_success 'cvs co (use attributes/guess)' '
|
|
|
|
GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess &&
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes "" &&
|
|
|
|
marked_as cvswork mixedUp.c "" &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h "" &&
|
|
|
|
marked_as cvswork/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork/subdir newfile.bin -kb &&
|
|
|
|
marked_as cvswork/subdir newfile.c ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'setup multi-line files' '
|
|
|
|
( echo "line 1" &&
|
|
|
|
echo "line 2" &&
|
|
|
|
echo "line 3" &&
|
|
|
|
echo "line 4 with NUL: Q <-" ) | q_to_nul > multiline.c &&
|
|
|
|
git add multiline.c &&
|
|
|
|
( echo "line 1" &&
|
|
|
|
echo "line 2" &&
|
|
|
|
echo "line 3" &&
|
|
|
|
echo "line 4" ) | q_to_nul > multilineTxt.c &&
|
|
|
|
git add multilineTxt.c &&
|
|
|
|
git commit -q -m "multiline files" &&
|
|
|
|
git push gitcvs.git >/dev/null
|
|
|
|
'
|
|
|
|
|
|
|
|
rm -rf cvswork
|
|
|
|
test_expect_success 'cvs co (guess)' '
|
|
|
|
GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false &&
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes "" &&
|
|
|
|
marked_as cvswork mixedUp.c -kb &&
|
|
|
|
marked_as cvswork multiline.c -kb &&
|
|
|
|
marked_as cvswork multilineTxt.c "" &&
|
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h "" &&
|
|
|
|
marked_as cvswork/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork/subdir newfile.bin "" &&
|
|
|
|
marked_as cvswork/subdir newfile.c ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'cvs co another copy (guess)' '
|
2020-11-19 00:44:42 +01:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork2 textfile.c "" &&
|
|
|
|
marked_as cvswork2 binfile.bin -kb &&
|
|
|
|
marked_as cvswork2 .gitattributes "" &&
|
|
|
|
marked_as cvswork2 mixedUp.c -kb &&
|
|
|
|
marked_as cvswork2 multiline.c -kb &&
|
|
|
|
marked_as cvswork2 multilineTxt.c "" &&
|
|
|
|
marked_as cvswork2/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork2/subdir file.h "" &&
|
|
|
|
marked_as cvswork2/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.bin "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.c ""
|
|
|
|
'
|
|
|
|
|
2012-10-14 07:42:23 +02:00
|
|
|
test_expect_success 'cvs status - sticky options' '
|
|
|
|
check_status_options cvswork2 textfile.c "" &&
|
|
|
|
check_status_options cvswork2 binfile.bin -kb &&
|
|
|
|
check_status_options cvswork2 .gitattributes "" &&
|
|
|
|
check_status_options cvswork2 mixedUp.c -kb &&
|
|
|
|
check_status_options cvswork2 multiline.c -kb &&
|
|
|
|
check_status_options cvswork2 multilineTxt.c "" &&
|
|
|
|
check_status_options cvswork2/subdir withCr.bin -kb &&
|
|
|
|
check_status_options cvswork2 subdir/withCr.bin -kb &&
|
|
|
|
check_status_options cvswork2/subdir file.h "" &&
|
|
|
|
check_status_options cvswork2 subdir/file.h "" &&
|
|
|
|
check_status_options cvswork2/subdir unspecified.other "" &&
|
|
|
|
check_status_options cvswork2/subdir newfile.bin "" &&
|
|
|
|
check_status_options cvswork2/subdir newfile.c ""
|
|
|
|
'
|
|
|
|
|
2008-05-15 06:35:48 +02:00
|
|
|
test_expect_success 'add text (guess)' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
2008-05-15 06:35:48 +02:00
|
|
|
echo "simpleText" > simpleText.c &&
|
2010-09-06 20:39:54 +02:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q add simpleText.c
|
|
|
|
) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork simpleText.c ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'add bin (guess)' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
2008-05-15 06:35:48 +02:00
|
|
|
echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin &&
|
2010-09-06 20:39:54 +02:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin
|
|
|
|
) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork simpleBin.bin -kb
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'remove files (guess)' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
2008-05-15 06:35:48 +02:00
|
|
|
GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h &&
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd subdir &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin
|
|
|
|
)) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork/subdir withCr.bin -kb &&
|
|
|
|
marked_as cvswork/subdir file.h ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'cvs ci (guess)' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1
|
|
|
|
) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork textfile.c "" &&
|
|
|
|
marked_as cvswork binfile.bin -kb &&
|
|
|
|
marked_as cvswork .gitattributes "" &&
|
|
|
|
marked_as cvswork mixedUp.c -kb &&
|
|
|
|
marked_as cvswork multiline.c -kb &&
|
|
|
|
marked_as cvswork multilineTxt.c "" &&
|
|
|
|
not_present cvswork/subdir withCr.bin &&
|
|
|
|
not_present cvswork/subdir file.h &&
|
|
|
|
marked_as cvswork/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork/subdir newfile.bin "" &&
|
|
|
|
marked_as cvswork/subdir newfile.c "" &&
|
|
|
|
marked_as cvswork simpleBin.bin -kb &&
|
|
|
|
marked_as cvswork simpleText.c ""
|
|
|
|
'
|
|
|
|
|
|
|
|
test_expect_success 'update subdir of other copy (guess)' '
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork2/subdir &&
|
|
|
|
GIT_CONFIG="$git_config" cvs -Q update
|
|
|
|
) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork2 textfile.c "" &&
|
|
|
|
marked_as cvswork2 binfile.bin -kb &&
|
|
|
|
marked_as cvswork2 .gitattributes "" &&
|
|
|
|
marked_as cvswork2 mixedUp.c -kb &&
|
|
|
|
marked_as cvswork2 multiline.c -kb &&
|
|
|
|
marked_as cvswork2 multilineTxt.c "" &&
|
|
|
|
not_present cvswork2/subdir withCr.bin &&
|
|
|
|
not_present cvswork2/subdir file.h &&
|
|
|
|
marked_as cvswork2/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.bin "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.c "" &&
|
|
|
|
not_present cvswork2 simpleBin.bin &&
|
|
|
|
not_present cvswork2 simpleText.c
|
|
|
|
'
|
|
|
|
|
|
|
|
echo "starting update/merge" >> "${WORKDIR}/marked.log"
|
|
|
|
test_expect_success 'update/merge full other copy (guess)' '
|
2020-11-19 00:44:42 +01:00
|
|
|
git pull gitcvs.git main &&
|
2008-05-15 06:35:48 +02:00
|
|
|
sed "s/3/replaced_3/" < multilineTxt.c > ml.temp &&
|
|
|
|
mv ml.temp multilineTxt.c &&
|
|
|
|
git add multilineTxt.c &&
|
|
|
|
git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" &&
|
|
|
|
git push gitcvs.git >/dev/null &&
|
2010-09-06 20:39:54 +02:00
|
|
|
(cd cvswork2 &&
|
2008-05-15 06:35:48 +02:00
|
|
|
sed "s/1/replaced_1/" < multilineTxt.c > ml.temp &&
|
|
|
|
mv ml.temp multilineTxt.c &&
|
2010-09-06 20:39:54 +02:00
|
|
|
GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1
|
|
|
|
) &&
|
2008-05-15 06:35:48 +02:00
|
|
|
marked_as cvswork2 textfile.c "" &&
|
|
|
|
marked_as cvswork2 binfile.bin -kb &&
|
|
|
|
marked_as cvswork2 .gitattributes "" &&
|
|
|
|
marked_as cvswork2 mixedUp.c -kb &&
|
|
|
|
marked_as cvswork2 multiline.c -kb &&
|
|
|
|
marked_as cvswork2 multilineTxt.c "" &&
|
|
|
|
not_present cvswork2/subdir withCr.bin &&
|
|
|
|
not_present cvswork2/subdir file.h &&
|
|
|
|
marked_as cvswork2/subdir unspecified.other "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.bin "" &&
|
|
|
|
marked_as cvswork2/subdir newfile.c "" &&
|
|
|
|
marked_as cvswork2 simpleBin.bin -kb &&
|
|
|
|
marked_as cvswork2 simpleText.c "" &&
|
|
|
|
echo "line replaced_1" > tmpExpect2 &&
|
|
|
|
echo "line 2" >> tmpExpect2 &&
|
|
|
|
echo "line replaced_3" >> tmpExpect2 &&
|
|
|
|
echo "line 4" | q_to_nul >> tmpExpect2 &&
|
|
|
|
cmp cvswork2/multilineTxt.c tmpExpect2
|
|
|
|
'
|
|
|
|
|
2008-05-15 06:35:47 +02:00
|
|
|
test_done
|