Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | # |
| 3 | # Copyright (c) 2008 Matthew Ogilvie |
| 4 | # Parts adapted from other tests. |
| 5 | # |
| 6 | |
| 7 | test_description='git-cvsserver -kb modes |
| 8 | |
| 9 | tests -kb mode for binary files when accessing a git |
| 10 | repository using cvs CLI client via git-cvsserver server' |
| 11 | |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 12 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
Johannes Schindelin | 334afbc | 2020-11-18 23:44:19 +0000 | [diff] [blame] | 13 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
| 14 | |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 15 | . ./test-lib.sh |
| 16 | |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 17 | marked_as () { |
| 18 | foundEntry="$(grep "^/$2/" "$1/CVS/Entries")" |
| 19 | if [ x"$foundEntry" = x"" ] ; then |
| 20 | echo "NOT FOUND: $1 $2 1 $3" >> "${WORKDIR}/marked.log" |
| 21 | return 1 |
| 22 | fi |
| 23 | test x"$(grep "^/$2/" "$1/CVS/Entries" | cut -d/ -f5)" = x"$3" |
| 24 | stat=$? |
| 25 | echo "$1 $2 $stat '$3'" >> "${WORKDIR}/marked.log" |
| 26 | return $stat |
| 27 | } |
| 28 | |
| 29 | not_present() { |
| 30 | foundEntry="$(grep "^/$2/" "$1/CVS/Entries")" |
| 31 | if [ -r "$1/$2" ] ; then |
| 32 | echo "Error: File still exists: $1 $2" >> "${WORKDIR}/marked.log" |
| 33 | return 1; |
| 34 | fi |
| 35 | if [ x"$foundEntry" != x"" ] ; then |
| 36 | echo "Error: should not have found: $1 $2" >> "${WORKDIR}/marked.log" |
| 37 | return 1; |
| 38 | else |
| 39 | echo "Correctly not found: $1 $2" >> "${WORKDIR}/marked.log" |
| 40 | return 0; |
| 41 | fi |
| 42 | } |
| 43 | |
Matthew Ogilvie | abd66f2 | 2012-10-13 23:42:23 -0600 | [diff] [blame] | 44 | check_status_options() { |
| 45 | (cd "$1" && |
| 46 | GIT_CONFIG="$git_config" cvs -Q status "$2" > "${WORKDIR}/status.out" 2>&1 |
| 47 | ) |
| 48 | if [ x"$?" != x"0" ] ; then |
| 49 | echo "Error from cvs status: $1 $2" >> "${WORKDIR}/marked.log" |
| 50 | return 1; |
| 51 | fi |
Ben Walton | db7fde9 | 2012-10-25 16:58:19 +0100 | [diff] [blame] | 52 | got="$(sed -n -e 's/^[ ]*Sticky Options:[ ]*//p' "${WORKDIR}/status.out")" |
Matthew Ogilvie | abd66f2 | 2012-10-13 23:42:23 -0600 | [diff] [blame] | 53 | expect="$3" |
| 54 | if [ x"$expect" = x"" ] ; then |
| 55 | expect="(none)" |
| 56 | fi |
| 57 | test x"$got" = x"$expect" |
| 58 | stat=$? |
| 59 | echo "cvs status: $1 $2 $stat '$3' '$got'" >> "${WORKDIR}/marked.log" |
| 60 | return $stat |
| 61 | } |
| 62 | |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 63 | cvs >/dev/null 2>&1 |
| 64 | if test $? -ne 1 |
| 65 | then |
Ævar Arnfjörð Bjarmason | fadb515 | 2010-06-24 17:44:48 +0000 | [diff] [blame] | 66 | skip_all='skipping git-cvsserver tests, cvs not found' |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 67 | test_done |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 68 | fi |
Jeff King | 1b19ccd | 2009-04-03 15:33:59 -0400 | [diff] [blame] | 69 | if ! test_have_prereq PERL |
| 70 | then |
Ævar Arnfjörð Bjarmason | fadb515 | 2010-06-24 17:44:48 +0000 | [diff] [blame] | 71 | skip_all='skipping git-cvsserver tests, perl not available' |
Jeff King | 1b19ccd | 2009-04-03 15:33:59 -0400 | [diff] [blame] | 72 | test_done |
| 73 | fi |
Jeff King | 94221d2 | 2013-10-28 21:23:03 -0400 | [diff] [blame] | 74 | perl -e 'use DBI; use DBD::SQLite' >/dev/null 2>&1 || { |
Ævar Arnfjörð Bjarmason | fadb515 | 2010-06-24 17:44:48 +0000 | [diff] [blame] | 75 | skip_all='skipping git-cvsserver tests, Perl SQLite interface unavailable' |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 76 | test_done |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 77 | } |
| 78 | |
| 79 | unset GIT_DIR GIT_CONFIG |
Johannes Schindelin | fd318a9 | 2016-01-27 17:19:59 +0100 | [diff] [blame] | 80 | WORKDIR=$PWD |
| 81 | SERVERDIR=$PWD/gitcvs.git |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 82 | git_config="$SERVERDIR/config" |
| 83 | CVSROOT=":fork:$SERVERDIR" |
Johannes Schindelin | fd318a9 | 2016-01-27 17:19:59 +0100 | [diff] [blame] | 84 | CVSWORK="$PWD/cvswork" |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 85 | CVS_SERVER=git-cvsserver |
| 86 | export CVSROOT CVS_SERVER |
| 87 | |
| 88 | rm -rf "$CVSWORK" "$SERVERDIR" |
| 89 | test_expect_success 'setup' ' |
Junio C Hamano | e2a83b2 | 2013-01-04 16:24:32 -0800 | [diff] [blame] | 90 | git config push.default matching && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 91 | echo "Simple text file" >textfile.c && |
| 92 | echo "File with embedded NUL: Q <- there" | q_to_nul > binfile.bin && |
| 93 | mkdir subdir && |
| 94 | echo "Another text file" > subdir/file.h && |
| 95 | echo "Another binary: Q (this time CR)" | q_to_cr > subdir/withCr.bin && |
Jonathan Nieder | a48fcd8 | 2010-10-30 20:46:54 -0500 | [diff] [blame] | 96 | echo "Mixed up NUL, but marked text: Q <- there" | q_to_nul > mixedUp.c && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 97 | echo "Unspecified" > subdir/unspecified.other && |
| 98 | echo "/*.bin -crlf" > .gitattributes && |
| 99 | echo "/*.c crlf" >> .gitattributes && |
| 100 | echo "subdir/*.bin -crlf" >> .gitattributes && |
| 101 | echo "subdir/*.c crlf" >> .gitattributes && |
| 102 | echo "subdir/file.h crlf" >> .gitattributes && |
| 103 | git add .gitattributes textfile.c binfile.bin mixedUp.c subdir/* && |
| 104 | git commit -q -m "First Commit" && |
Johannes Sixt | 7fd3ef1 | 2009-03-07 00:04:09 +0100 | [diff] [blame] | 105 | git clone -q --bare "$WORKDIR/.git" "$SERVERDIR" >/dev/null 2>&1 && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 106 | GIT_DIR="$SERVERDIR" git config --bool gitcvs.enabled true && |
| 107 | GIT_DIR="$SERVERDIR" git config gitcvs.logfile "$SERVERDIR/gitcvs.log" |
| 108 | ' |
| 109 | |
| 110 | test_expect_success 'cvs co (default crlf)' ' |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 111 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 112 | test x"$(grep '/-k' cvswork/CVS/Entries cvswork/subdir/CVS/Entries)" = x"" |
| 113 | ' |
| 114 | |
| 115 | rm -rf cvswork |
| 116 | test_expect_success 'cvs co (allbinary)' ' |
| 117 | GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary true && |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 118 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 119 | marked_as cvswork textfile.c -kb && |
| 120 | marked_as cvswork binfile.bin -kb && |
| 121 | marked_as cvswork .gitattributes -kb && |
| 122 | marked_as cvswork mixedUp.c -kb && |
| 123 | marked_as cvswork/subdir withCr.bin -kb && |
| 124 | marked_as cvswork/subdir file.h -kb && |
| 125 | marked_as cvswork/subdir unspecified.other -kb |
| 126 | ' |
| 127 | |
| 128 | rm -rf cvswork cvs.log |
| 129 | test_expect_success 'cvs co (use attributes/allbinary)' ' |
| 130 | GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr true && |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 131 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 132 | marked_as cvswork textfile.c "" && |
| 133 | marked_as cvswork binfile.bin -kb && |
| 134 | marked_as cvswork .gitattributes -kb && |
| 135 | marked_as cvswork mixedUp.c "" && |
| 136 | marked_as cvswork/subdir withCr.bin -kb && |
| 137 | marked_as cvswork/subdir file.h "" && |
| 138 | marked_as cvswork/subdir unspecified.other -kb |
| 139 | ' |
| 140 | |
| 141 | rm -rf cvswork |
| 142 | test_expect_success 'cvs co (use attributes)' ' |
| 143 | GIT_DIR="$SERVERDIR" git config --bool gitcvs.allbinary false && |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 144 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 145 | marked_as cvswork textfile.c "" && |
| 146 | marked_as cvswork binfile.bin -kb && |
| 147 | marked_as cvswork .gitattributes "" && |
| 148 | marked_as cvswork mixedUp.c "" && |
| 149 | marked_as cvswork/subdir withCr.bin -kb && |
| 150 | marked_as cvswork/subdir file.h "" && |
| 151 | marked_as cvswork/subdir unspecified.other "" |
| 152 | ' |
| 153 | |
| 154 | test_expect_success 'adding files' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 155 | (cd cvswork && |
| 156 | (cd subdir && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 157 | echo "more text" > src.c && |
| 158 | GIT_CONFIG="$git_config" cvs -Q add src.c >cvs.log 2>&1 && |
| 159 | marked_as . src.c "" && |
Ville Skyttä | 2e3a16b | 2016-08-09 11:53:38 +0300 | [diff] [blame] | 160 | echo "pseudo-binary" > temp.bin |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 161 | ) && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 162 | GIT_CONFIG="$git_config" cvs -Q add subdir/temp.bin >cvs.log 2>&1 && |
| 163 | marked_as subdir temp.bin "-kb" && |
| 164 | cd subdir && |
| 165 | GIT_CONFIG="$git_config" cvs -Q ci -m "adding files" >cvs.log 2>&1 && |
| 166 | marked_as . temp.bin "-kb" && |
| 167 | marked_as . src.c "" |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 168 | ) |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 169 | ' |
| 170 | |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 171 | test_expect_success 'updating' ' |
| 172 | git pull gitcvs.git && |
Martin Ågren | c76b84a | 2020-08-06 22:08:53 +0200 | [diff] [blame] | 173 | echo "hi" >subdir/newfile.bin && |
| 174 | echo "junk" >subdir/file.h && |
| 175 | echo "hi" >subdir/newfile.c && |
| 176 | echo "hello" >>binfile.bin && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 177 | git add subdir/newfile.bin subdir/file.h subdir/newfile.c binfile.bin && |
| 178 | git commit -q -m "Add and change some files" && |
| 179 | git push gitcvs.git >/dev/null && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 180 | (cd cvswork && |
| 181 | GIT_CONFIG="$git_config" cvs -Q update |
| 182 | ) && |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 183 | marked_as cvswork textfile.c "" && |
| 184 | marked_as cvswork binfile.bin -kb && |
| 185 | marked_as cvswork .gitattributes "" && |
| 186 | marked_as cvswork mixedUp.c "" && |
| 187 | marked_as cvswork/subdir withCr.bin -kb && |
| 188 | marked_as cvswork/subdir file.h "" && |
| 189 | marked_as cvswork/subdir unspecified.other "" && |
| 190 | marked_as cvswork/subdir newfile.bin -kb && |
| 191 | marked_as cvswork/subdir newfile.c "" && |
| 192 | echo "File with embedded NUL: Q <- there" | q_to_nul > tmpExpect1 && |
| 193 | echo "hello" >> tmpExpect1 && |
| 194 | cmp cvswork/binfile.bin tmpExpect1 |
| 195 | ' |
| 196 | |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 197 | rm -rf cvswork |
| 198 | test_expect_success 'cvs co (use attributes/guess)' ' |
| 199 | GIT_DIR="$SERVERDIR" git config gitcvs.allbinary guess && |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 200 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 201 | marked_as cvswork textfile.c "" && |
| 202 | marked_as cvswork binfile.bin -kb && |
| 203 | marked_as cvswork .gitattributes "" && |
| 204 | marked_as cvswork mixedUp.c "" && |
| 205 | marked_as cvswork/subdir withCr.bin -kb && |
| 206 | marked_as cvswork/subdir file.h "" && |
| 207 | marked_as cvswork/subdir unspecified.other "" && |
| 208 | marked_as cvswork/subdir newfile.bin -kb && |
| 209 | marked_as cvswork/subdir newfile.c "" |
| 210 | ' |
| 211 | |
| 212 | test_expect_success 'setup multi-line files' ' |
| 213 | ( echo "line 1" && |
| 214 | echo "line 2" && |
| 215 | echo "line 3" && |
| 216 | echo "line 4 with NUL: Q <-" ) | q_to_nul > multiline.c && |
| 217 | git add multiline.c && |
| 218 | ( echo "line 1" && |
| 219 | echo "line 2" && |
| 220 | echo "line 3" && |
| 221 | echo "line 4" ) | q_to_nul > multilineTxt.c && |
| 222 | git add multilineTxt.c && |
| 223 | git commit -q -m "multiline files" && |
| 224 | git push gitcvs.git >/dev/null |
| 225 | ' |
| 226 | |
| 227 | rm -rf cvswork |
| 228 | test_expect_success 'cvs co (guess)' ' |
| 229 | GIT_DIR="$SERVERDIR" git config --bool gitcvs.usecrlfattr false && |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 230 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork main >cvs.log 2>&1 && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 231 | marked_as cvswork textfile.c "" && |
| 232 | marked_as cvswork binfile.bin -kb && |
| 233 | marked_as cvswork .gitattributes "" && |
| 234 | marked_as cvswork mixedUp.c -kb && |
| 235 | marked_as cvswork multiline.c -kb && |
| 236 | marked_as cvswork multilineTxt.c "" && |
| 237 | marked_as cvswork/subdir withCr.bin -kb && |
| 238 | marked_as cvswork/subdir file.h "" && |
| 239 | marked_as cvswork/subdir unspecified.other "" && |
| 240 | marked_as cvswork/subdir newfile.bin "" && |
| 241 | marked_as cvswork/subdir newfile.c "" |
| 242 | ' |
| 243 | |
| 244 | test_expect_success 'cvs co another copy (guess)' ' |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 245 | GIT_CONFIG="$git_config" cvs -Q co -d cvswork2 main >cvs.log 2>&1 && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 246 | marked_as cvswork2 textfile.c "" && |
| 247 | marked_as cvswork2 binfile.bin -kb && |
| 248 | marked_as cvswork2 .gitattributes "" && |
| 249 | marked_as cvswork2 mixedUp.c -kb && |
| 250 | marked_as cvswork2 multiline.c -kb && |
| 251 | marked_as cvswork2 multilineTxt.c "" && |
| 252 | marked_as cvswork2/subdir withCr.bin -kb && |
| 253 | marked_as cvswork2/subdir file.h "" && |
| 254 | marked_as cvswork2/subdir unspecified.other "" && |
| 255 | marked_as cvswork2/subdir newfile.bin "" && |
| 256 | marked_as cvswork2/subdir newfile.c "" |
| 257 | ' |
| 258 | |
Matthew Ogilvie | abd66f2 | 2012-10-13 23:42:23 -0600 | [diff] [blame] | 259 | test_expect_success 'cvs status - sticky options' ' |
| 260 | check_status_options cvswork2 textfile.c "" && |
| 261 | check_status_options cvswork2 binfile.bin -kb && |
| 262 | check_status_options cvswork2 .gitattributes "" && |
| 263 | check_status_options cvswork2 mixedUp.c -kb && |
| 264 | check_status_options cvswork2 multiline.c -kb && |
| 265 | check_status_options cvswork2 multilineTxt.c "" && |
| 266 | check_status_options cvswork2/subdir withCr.bin -kb && |
| 267 | check_status_options cvswork2 subdir/withCr.bin -kb && |
| 268 | check_status_options cvswork2/subdir file.h "" && |
| 269 | check_status_options cvswork2 subdir/file.h "" && |
| 270 | check_status_options cvswork2/subdir unspecified.other "" && |
| 271 | check_status_options cvswork2/subdir newfile.bin "" && |
| 272 | check_status_options cvswork2/subdir newfile.c "" |
| 273 | ' |
| 274 | |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 275 | test_expect_success 'add text (guess)' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 276 | (cd cvswork && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 277 | echo "simpleText" > simpleText.c && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 278 | GIT_CONFIG="$git_config" cvs -Q add simpleText.c |
| 279 | ) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 280 | marked_as cvswork simpleText.c "" |
| 281 | ' |
| 282 | |
| 283 | test_expect_success 'add bin (guess)' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 284 | (cd cvswork && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 285 | echo "simpleBin: NUL: Q <- there" | q_to_nul > simpleBin.bin && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 286 | GIT_CONFIG="$git_config" cvs -Q add simpleBin.bin |
| 287 | ) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 288 | marked_as cvswork simpleBin.bin -kb |
| 289 | ' |
| 290 | |
| 291 | test_expect_success 'remove files (guess)' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 292 | (cd cvswork && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 293 | GIT_CONFIG="$git_config" cvs -Q rm -f subdir/file.h && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 294 | (cd subdir && |
| 295 | GIT_CONFIG="$git_config" cvs -Q rm -f withCr.bin |
| 296 | )) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 297 | marked_as cvswork/subdir withCr.bin -kb && |
| 298 | marked_as cvswork/subdir file.h "" |
| 299 | ' |
| 300 | |
| 301 | test_expect_success 'cvs ci (guess)' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 302 | (cd cvswork && |
| 303 | GIT_CONFIG="$git_config" cvs -Q ci -m "add/rm files" >cvs.log 2>&1 |
| 304 | ) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 305 | marked_as cvswork textfile.c "" && |
| 306 | marked_as cvswork binfile.bin -kb && |
| 307 | marked_as cvswork .gitattributes "" && |
| 308 | marked_as cvswork mixedUp.c -kb && |
| 309 | marked_as cvswork multiline.c -kb && |
| 310 | marked_as cvswork multilineTxt.c "" && |
| 311 | not_present cvswork/subdir withCr.bin && |
| 312 | not_present cvswork/subdir file.h && |
| 313 | marked_as cvswork/subdir unspecified.other "" && |
| 314 | marked_as cvswork/subdir newfile.bin "" && |
| 315 | marked_as cvswork/subdir newfile.c "" && |
| 316 | marked_as cvswork simpleBin.bin -kb && |
| 317 | marked_as cvswork simpleText.c "" |
| 318 | ' |
| 319 | |
| 320 | test_expect_success 'update subdir of other copy (guess)' ' |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 321 | (cd cvswork2/subdir && |
| 322 | GIT_CONFIG="$git_config" cvs -Q update |
| 323 | ) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 324 | marked_as cvswork2 textfile.c "" && |
| 325 | marked_as cvswork2 binfile.bin -kb && |
| 326 | marked_as cvswork2 .gitattributes "" && |
| 327 | marked_as cvswork2 mixedUp.c -kb && |
| 328 | marked_as cvswork2 multiline.c -kb && |
| 329 | marked_as cvswork2 multilineTxt.c "" && |
| 330 | not_present cvswork2/subdir withCr.bin && |
| 331 | not_present cvswork2/subdir file.h && |
| 332 | marked_as cvswork2/subdir unspecified.other "" && |
| 333 | marked_as cvswork2/subdir newfile.bin "" && |
| 334 | marked_as cvswork2/subdir newfile.c "" && |
| 335 | not_present cvswork2 simpleBin.bin && |
| 336 | not_present cvswork2 simpleText.c |
| 337 | ' |
| 338 | |
| 339 | echo "starting update/merge" >> "${WORKDIR}/marked.log" |
| 340 | test_expect_success 'update/merge full other copy (guess)' ' |
Johannes Schindelin | a881baa | 2020-11-18 23:44:42 +0000 | [diff] [blame] | 341 | git pull gitcvs.git main && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 342 | sed "s/3/replaced_3/" < multilineTxt.c > ml.temp && |
| 343 | mv ml.temp multilineTxt.c && |
| 344 | git add multilineTxt.c && |
| 345 | git commit -q -m "modify multiline file" >> "${WORKDIR}/marked.log" && |
| 346 | git push gitcvs.git >/dev/null && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 347 | (cd cvswork2 && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 348 | sed "s/1/replaced_1/" < multilineTxt.c > ml.temp && |
| 349 | mv ml.temp multilineTxt.c && |
Jens Lehmann | fd4ec4f | 2010-09-06 20:39:54 +0200 | [diff] [blame] | 350 | GIT_CONFIG="$git_config" cvs update > cvs.log 2>&1 |
| 351 | ) && |
Matthew Ogilvie | 90948a4 | 2008-05-14 22:35:48 -0600 | [diff] [blame] | 352 | marked_as cvswork2 textfile.c "" && |
| 353 | marked_as cvswork2 binfile.bin -kb && |
| 354 | marked_as cvswork2 .gitattributes "" && |
| 355 | marked_as cvswork2 mixedUp.c -kb && |
| 356 | marked_as cvswork2 multiline.c -kb && |
| 357 | marked_as cvswork2 multilineTxt.c "" && |
| 358 | not_present cvswork2/subdir withCr.bin && |
| 359 | not_present cvswork2/subdir file.h && |
| 360 | marked_as cvswork2/subdir unspecified.other "" && |
| 361 | marked_as cvswork2/subdir newfile.bin "" && |
| 362 | marked_as cvswork2/subdir newfile.c "" && |
| 363 | marked_as cvswork2 simpleBin.bin -kb && |
| 364 | marked_as cvswork2 simpleText.c "" && |
| 365 | echo "line replaced_1" > tmpExpect2 && |
| 366 | echo "line 2" >> tmpExpect2 && |
| 367 | echo "line replaced_3" >> tmpExpect2 && |
| 368 | echo "line 4" | q_to_nul >> tmpExpect2 && |
| 369 | cmp cvswork2/multilineTxt.c tmpExpect2 |
| 370 | ' |
| 371 | |
Matthew Ogilvie | 8a06a63 | 2008-05-14 22:35:47 -0600 | [diff] [blame] | 372 | test_done |