Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 1 | #!/bin/sh |
| 2 | |
| 3 | test_description=clone |
| 4 | |
| 5 | . ./test-lib.sh |
| 6 | |
Johannes Schindelin | 3064d5a | 2016-01-27 17:19:37 +0100 | [diff] [blame] | 7 | X= |
| 8 | test_have_prereq !MINGW || X=.exe |
| 9 | |
Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 10 | test_expect_success setup ' |
| 11 | |
| 12 | rm -fr .git && |
| 13 | test_create_repo src && |
| 14 | ( |
Nguyễn Thái Ngọc Duy | bafe763 | 2012-01-16 16:46:07 +0700 | [diff] [blame] | 15 | cd src && |
| 16 | >file && |
| 17 | git add file && |
Nguyễn Thái Ngọc Duy | 7f08c68 | 2012-01-16 16:46:08 +0700 | [diff] [blame] | 18 | git commit -m initial && |
| 19 | echo 1 >file && |
| 20 | git add file && |
| 21 | git commit -m updated |
Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 22 | ) |
| 23 | |
| 24 | ' |
| 25 | |
Shawn O. Pearce | 1db4a75 | 2008-07-08 04:46:06 +0000 | [diff] [blame] | 26 | test_expect_success 'clone with excess parameters (1)' ' |
Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 27 | |
Shawn O. Pearce | 1db4a75 | 2008-07-08 04:46:06 +0000 | [diff] [blame] | 28 | rm -fr dst && |
| 29 | test_must_fail git clone -n src dst junk |
| 30 | |
| 31 | ' |
| 32 | |
| 33 | test_expect_success 'clone with excess parameters (2)' ' |
| 34 | |
| 35 | rm -fr dst && |
Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 36 | test_must_fail git clone -n "file://$(pwd)/src" dst junk |
| 37 | |
| 38 | ' |
| 39 | |
Ævar Arnfjörð Bjarmason | 5cde598 | 2011-02-22 23:41:28 +0000 | [diff] [blame] | 40 | test_expect_success C_LOCALE_OUTPUT 'output from clone' ' |
Anders Melchiorsen | 2c3766f | 2008-08-04 02:30:03 +0200 | [diff] [blame] | 41 | rm -fr dst && |
Jeff King | 68b939b | 2013-09-18 16:05:13 -0400 | [diff] [blame] | 42 | git clone -n "file://$(pwd)/src" dst >output 2>&1 && |
Junio C Hamano | 28ba96a | 2010-04-23 14:37:22 +0200 | [diff] [blame] | 43 | test $(grep Clon output | wc -l) = 1 |
Anders Melchiorsen | 2c3766f | 2008-08-04 02:30:03 +0200 | [diff] [blame] | 44 | ' |
| 45 | |
Shawn O. Pearce | 1db4a75 | 2008-07-08 04:46:06 +0000 | [diff] [blame] | 46 | test_expect_success 'clone does not keep pack' ' |
| 47 | |
| 48 | rm -fr dst && |
| 49 | git clone -n "file://$(pwd)/src" dst && |
| 50 | ! test -f dst/file && |
| 51 | ! (echo dst/.git/objects/pack/pack-* | grep "\.keep") |
| 52 | |
| 53 | ' |
| 54 | |
Johannes Schindelin | a73bc12 | 2008-05-15 10:48:25 +0100 | [diff] [blame] | 55 | test_expect_success 'clone checks out files' ' |
| 56 | |
Shawn O. Pearce | 1db4a75 | 2008-07-08 04:46:06 +0000 | [diff] [blame] | 57 | rm -fr dst && |
Johannes Schindelin | a73bc12 | 2008-05-15 10:48:25 +0100 | [diff] [blame] | 58 | git clone src dst && |
| 59 | test -f dst/file |
| 60 | |
| 61 | ' |
| 62 | |
Jeff King | 2beebd2 | 2008-06-25 01:41:34 -0400 | [diff] [blame] | 63 | test_expect_success 'clone respects GIT_WORK_TREE' ' |
| 64 | |
| 65 | GIT_WORK_TREE=worktree git clone src bare && |
| 66 | test -f bare/config && |
| 67 | test -f worktree/file |
| 68 | |
| 69 | ' |
| 70 | |
Nguyễn Thái Ngọc Duy | 86d26f2 | 2015-12-20 14:50:18 +0700 | [diff] [blame] | 71 | test_expect_success 'clone from hooks' ' |
| 72 | |
| 73 | test_create_repo r0 && |
| 74 | cd r0 && |
| 75 | test_commit initial && |
| 76 | cd .. && |
| 77 | git init r1 && |
| 78 | cd r1 && |
| 79 | cat >.git/hooks/pre-commit <<-\EOF && |
| 80 | #!/bin/sh |
| 81 | git clone ../r0 ../r2 |
| 82 | exit 1 |
| 83 | EOF |
| 84 | chmod u+x .git/hooks/pre-commit && |
| 85 | : >file && |
| 86 | git add file && |
| 87 | test_must_fail git commit -m invoke-hook && |
| 88 | cd .. && |
| 89 | test_cmp r0/.git/HEAD r2/.git/HEAD && |
| 90 | test_cmp r0/initial.t r2/initial.t |
| 91 | |
| 92 | ' |
| 93 | |
Jeff King | 2beebd2 | 2008-06-25 01:41:34 -0400 | [diff] [blame] | 94 | test_expect_success 'clone creates intermediate directories' ' |
| 95 | |
| 96 | git clone src long/path/to/dst && |
| 97 | test -f long/path/to/dst/file |
| 98 | |
| 99 | ' |
| 100 | |
| 101 | test_expect_success 'clone creates intermediate directories for bare repo' ' |
| 102 | |
| 103 | git clone --bare src long/path/to/bare/dst && |
| 104 | test -f long/path/to/bare/dst/config |
| 105 | |
| 106 | ' |
| 107 | |
Johannes Schindelin | bc699af | 2008-08-02 21:38:56 +0200 | [diff] [blame] | 108 | test_expect_success 'clone --mirror' ' |
| 109 | |
| 110 | git clone --mirror src mirror && |
| 111 | test -f mirror/HEAD && |
| 112 | test ! -f mirror/file && |
| 113 | FETCH="$(cd mirror && git config remote.origin.fetch)" && |
| 114 | test "+refs/*:refs/*" = "$FETCH" && |
| 115 | MIRROR="$(cd mirror && git config --bool remote.origin.mirror)" && |
| 116 | test "$MIRROR" = true |
| 117 | |
| 118 | ' |
| 119 | |
Nguyễn Thái Ngọc Duy | 7f08c68 | 2012-01-16 16:46:08 +0700 | [diff] [blame] | 120 | test_expect_success 'clone --mirror with detached HEAD' ' |
| 121 | |
| 122 | ( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) && |
| 123 | git clone --mirror src mirror.detached && |
| 124 | ( cd src && git checkout - ) && |
| 125 | GIT_DIR=mirror.detached git rev-parse HEAD >actual && |
| 126 | test_cmp expected actual |
| 127 | |
| 128 | ' |
| 129 | |
| 130 | test_expect_success 'clone --bare with detached HEAD' ' |
| 131 | |
| 132 | ( cd src && git checkout HEAD^ && git rev-parse HEAD >../expected ) && |
| 133 | git clone --bare src bare.detached && |
| 134 | ( cd src && git checkout - ) && |
| 135 | GIT_DIR=bare.detached git rev-parse HEAD >actual && |
| 136 | test_cmp expected actual |
| 137 | |
| 138 | ' |
| 139 | |
Johannes Schindelin | 6612f87 | 2008-08-01 16:01:36 +0200 | [diff] [blame] | 140 | test_expect_success 'clone --bare names the local repository <name>.git' ' |
| 141 | |
| 142 | git clone --bare src && |
| 143 | test -d src.git |
| 144 | |
| 145 | ' |
| 146 | |
Johannes Schindelin | 468386a | 2008-08-08 04:29:35 +0200 | [diff] [blame] | 147 | test_expect_success 'clone --mirror does not repeat tags' ' |
| 148 | |
| 149 | (cd src && |
| 150 | git tag some-tag HEAD) && |
| 151 | git clone --mirror src mirror2 && |
| 152 | (cd mirror2 && |
| 153 | git show-ref 2> clone.err > clone.out) && |
Pranit Bauva | c7cf956 | 2017-01-04 01:27:07 +0530 | [diff] [blame] | 154 | ! grep Duplicate mirror2/clone.err && |
Johannes Schindelin | 468386a | 2008-08-08 04:29:35 +0200 | [diff] [blame] | 155 | grep some-tag mirror2/clone.out |
| 156 | |
| 157 | ' |
| 158 | |
Clemens Buchacher | 44a68fd | 2008-09-03 20:55:55 +0200 | [diff] [blame] | 159 | test_expect_success 'clone to destination with trailing /' ' |
| 160 | |
| 161 | git clone src target-1/ && |
| 162 | T=$( cd target-1 && git rev-parse HEAD ) && |
| 163 | S=$( cd src && git rev-parse HEAD ) && |
| 164 | test "$T" = "$S" |
| 165 | |
| 166 | ' |
| 167 | |
| 168 | test_expect_success 'clone to destination with extra trailing /' ' |
| 169 | |
| 170 | git clone src target-2/// && |
| 171 | T=$( cd target-2 && git rev-parse HEAD ) && |
| 172 | S=$( cd src && git rev-parse HEAD ) && |
| 173 | test "$T" = "$S" |
| 174 | |
| 175 | ' |
| 176 | |
Alexander Potashev | 55892d2 | 2009-01-11 15:19:12 +0300 | [diff] [blame] | 177 | test_expect_success 'clone to an existing empty directory' ' |
| 178 | mkdir target-3 && |
| 179 | git clone src target-3 && |
| 180 | T=$( cd target-3 && git rev-parse HEAD ) && |
| 181 | S=$( cd src && git rev-parse HEAD ) && |
| 182 | test "$T" = "$S" |
| 183 | ' |
| 184 | |
| 185 | test_expect_success 'clone to an existing non-empty directory' ' |
| 186 | mkdir target-4 && |
| 187 | >target-4/Fakefile && |
| 188 | test_must_fail git clone src target-4 |
| 189 | ' |
| 190 | |
| 191 | test_expect_success 'clone to an existing path' ' |
| 192 | >target-5 && |
| 193 | test_must_fail git clone src target-5 |
| 194 | ' |
| 195 | |
Junio C Hamano | 5cd12b8 | 2009-02-11 22:42:27 -0800 | [diff] [blame] | 196 | test_expect_success 'clone a void' ' |
| 197 | mkdir src-0 && |
| 198 | ( |
| 199 | cd src-0 && git init |
| 200 | ) && |
Jeff King | 12d4996 | 2009-09-02 02:36:47 -0400 | [diff] [blame] | 201 | git clone "file://$(pwd)/src-0" target-6 2>err-6 && |
| 202 | ! grep "fatal:" err-6 && |
Junio C Hamano | 5cd12b8 | 2009-02-11 22:42:27 -0800 | [diff] [blame] | 203 | ( |
| 204 | cd src-0 && test_commit A |
| 205 | ) && |
Jeff King | 12d4996 | 2009-09-02 02:36:47 -0400 | [diff] [blame] | 206 | git clone "file://$(pwd)/src-0" target-7 2>err-7 && |
| 207 | ! grep "fatal:" err-7 && |
Junio C Hamano | 5cd12b8 | 2009-02-11 22:42:27 -0800 | [diff] [blame] | 208 | # There is no reason to insist they are bit-for-bit |
| 209 | # identical, but this test should suffice for now. |
| 210 | test_cmp target-6/.git/config target-7/.git/config |
| 211 | ' |
| 212 | |
Junio C Hamano | a9f2c13 | 2009-03-03 22:29:55 -0800 | [diff] [blame] | 213 | test_expect_success 'clone respects global branch.autosetuprebase' ' |
| 214 | ( |
Junio C Hamano | a9f2c13 | 2009-03-03 22:29:55 -0800 | [diff] [blame] | 215 | test_config="$HOME/.gitconfig" && |
Junio C Hamano | a9f2c13 | 2009-03-03 22:29:55 -0800 | [diff] [blame] | 216 | git config -f "$test_config" branch.autosetuprebase remote && |
| 217 | rm -fr dst && |
| 218 | git clone src dst && |
| 219 | cd dst && |
| 220 | actual="z$(git config branch.master.rebase)" && |
| 221 | test ztrue = $actual |
| 222 | ) |
| 223 | ' |
| 224 | |
Jeff King | 9d2e942 | 2010-05-23 05:19:44 -0400 | [diff] [blame] | 225 | test_expect_success 'respect url-encoding of file://' ' |
| 226 | git init x+y && |
Thomas Rast | 730220d | 2010-07-24 16:49:04 +0200 | [diff] [blame] | 227 | git clone "file://$PWD/x+y" xy-url-1 && |
| 228 | git clone "file://$PWD/x%2By" xy-url-2 |
| 229 | ' |
| 230 | |
| 231 | test_expect_success 'do not query-string-decode + in URLs' ' |
| 232 | rm -rf x+y && |
| 233 | git init "x y" && |
| 234 | test_must_fail git clone "file://$PWD/x+y" xy-no-plus |
Jeff King | 9d2e942 | 2010-05-23 05:19:44 -0400 | [diff] [blame] | 235 | ' |
| 236 | |
| 237 | test_expect_success 'do not respect url-encoding of non-url path' ' |
| 238 | git init x+y && |
| 239 | test_must_fail git clone x%2By xy-regular && |
| 240 | git clone x+y xy-regular |
| 241 | ' |
| 242 | |
Nguyễn Thái Ngọc Duy | b57fb80 | 2011-03-19 22:16:56 +0700 | [diff] [blame] | 243 | test_expect_success 'clone separate gitdir' ' |
| 244 | rm -rf dst && |
| 245 | git clone --separate-git-dir realgitdir src dst && |
Nguyễn Thái Ngọc Duy | b57fb80 | 2011-03-19 22:16:56 +0700 | [diff] [blame] | 246 | test -d realgitdir/refs |
| 247 | ' |
| 248 | |
Junio C Hamano | 33d56fa | 2011-04-12 16:29:19 -0700 | [diff] [blame] | 249 | test_expect_success 'clone separate gitdir: output' ' |
Elia Pinto | c723e50 | 2016-01-04 10:10:49 +0100 | [diff] [blame] | 250 | echo "gitdir: $(pwd)/realgitdir" >expected && |
Ævar Arnfjörð Bjarmason | 2c050e0 | 2011-04-10 19:34:02 +0000 | [diff] [blame] | 251 | test_cmp expected dst/.git |
| 252 | ' |
| 253 | |
Nguyễn Thái Ngọc Duy | 9b0ebc7 | 2011-08-21 18:58:09 +0700 | [diff] [blame] | 254 | test_expect_success 'clone from .git file' ' |
| 255 | git clone dst/.git dst2 |
| 256 | ' |
| 257 | |
Phil Hord | 0c80fdb | 2011-10-04 16:09:23 -0400 | [diff] [blame] | 258 | test_expect_success 'fetch from .git gitfile' ' |
| 259 | ( |
| 260 | cd dst2 && |
| 261 | git fetch ../dst/.git |
| 262 | ) |
| 263 | ' |
| 264 | |
| 265 | test_expect_success 'fetch from gitfile parent' ' |
| 266 | ( |
| 267 | cd dst2 && |
| 268 | git fetch ../dst |
| 269 | ) |
| 270 | ' |
| 271 | |
Nguyễn Thái Ngọc Duy | b57fb80 | 2011-03-19 22:16:56 +0700 | [diff] [blame] | 272 | test_expect_success 'clone separate gitdir where target already exists' ' |
| 273 | rm -rf dst && |
| 274 | test_must_fail git clone --separate-git-dir realgitdir src dst |
| 275 | ' |
| 276 | |
Junio C Hamano | e6baf4a | 2011-08-22 18:05:16 -0700 | [diff] [blame] | 277 | test_expect_success 'clone --reference from original' ' |
Junio C Hamano | dbc92b0 | 2011-08-22 18:05:15 -0700 | [diff] [blame] | 278 | git clone --shared --bare src src-1 && |
| 279 | git clone --bare src src-2 && |
| 280 | git clone --reference=src-2 --bare src-1 target-8 && |
| 281 | grep /src-2/ target-8/objects/info/alternates |
| 282 | ' |
| 283 | |
| 284 | test_expect_success 'clone with more than one --reference' ' |
| 285 | git clone --bare src src-3 && |
| 286 | git clone --bare src src-4 && |
| 287 | git clone --reference=src-3 --reference=src-4 src target-9 && |
| 288 | grep /src-3/ target-9/.git/objects/info/alternates && |
| 289 | grep /src-4/ target-9/.git/objects/info/alternates |
| 290 | ' |
| 291 | |
Junio C Hamano | e6baf4a | 2011-08-22 18:05:16 -0700 | [diff] [blame] | 292 | test_expect_success 'clone from original with relative alternate' ' |
| 293 | mkdir nest && |
| 294 | git clone --bare src nest/src-5 && |
| 295 | echo ../../../src/.git/objects >nest/src-5/objects/info/alternates && |
| 296 | git clone --bare nest/src-5 target-10 && |
| 297 | grep /src/\\.git/objects target-10/objects/info/alternates |
| 298 | ' |
| 299 | |
Nguyễn Thái Ngọc Duy | 5a7d5b6 | 2012-01-16 16:46:15 +0700 | [diff] [blame] | 300 | test_expect_success 'clone checking out a tag' ' |
| 301 | git clone --branch=some-tag src dst.tag && |
| 302 | GIT_DIR=src/.git git rev-parse some-tag >expected && |
| 303 | test_cmp expected dst.tag/.git/HEAD && |
| 304 | GIT_DIR=dst.tag/.git git config remote.origin.fetch >fetch.actual && |
| 305 | echo "+refs/heads/*:refs/remotes/origin/*" >fetch.expected && |
| 306 | test_cmp fetch.expected fetch.actual |
| 307 | ' |
| 308 | |
Jonathan Nieder | 8339805 | 2017-11-20 17:49:19 -0800 | [diff] [blame] | 309 | test_expect_success 'set up ssh wrapper' ' |
| 310 | cp "$GIT_BUILD_DIR/t/helper/test-fake-ssh$X" \ |
| 311 | "$TRASH_DIRECTORY/ssh$X" && |
| 312 | GIT_SSH="$TRASH_DIRECTORY/ssh$X" && |
| 313 | export GIT_SSH && |
| 314 | export TRASH_DIRECTORY && |
| 315 | >"$TRASH_DIRECTORY"/ssh-output |
| 316 | ' |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 317 | |
brian m. carlson | baaf233 | 2015-04-26 20:30:12 +0000 | [diff] [blame] | 318 | copy_ssh_wrapper_as () { |
Junio C Hamano | cff48cc | 2017-10-17 14:04:43 +0900 | [diff] [blame] | 319 | rm -f "${1%$X}$X" && |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 320 | cp "$TRASH_DIRECTORY/ssh$X" "${1%$X}$X" && |
Jonathan Nieder | 8339805 | 2017-11-20 17:49:19 -0800 | [diff] [blame] | 321 | test_when_finished "rm $(git rev-parse --sq-quote "${1%$X}$X")" && |
Johannes Schindelin | 3064d5a | 2016-01-27 17:19:37 +0100 | [diff] [blame] | 322 | GIT_SSH="${1%$X}$X" && |
Jonathan Nieder | 8339805 | 2017-11-20 17:49:19 -0800 | [diff] [blame] | 323 | test_when_finished "GIT_SSH=\"\$TRASH_DIRECTORY/ssh\$X\"" |
brian m. carlson | baaf233 | 2015-04-26 20:30:12 +0000 | [diff] [blame] | 324 | } |
| 325 | |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 326 | expect_ssh () { |
Torsten Bögershausen | 710eb3e | 2013-11-28 20:53:47 +0100 | [diff] [blame] | 327 | test_when_finished ' |
| 328 | (cd "$TRASH_DIRECTORY" && rm -f ssh-expect && >ssh-output) |
| 329 | ' && |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 330 | { |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 331 | case "$#" in |
| 332 | 1) |
| 333 | ;; |
| 334 | 2) |
| 335 | echo "ssh: $1 git-upload-pack '$2'" |
| 336 | ;; |
| 337 | 3) |
| 338 | echo "ssh: $1 $2 git-upload-pack '$3'" |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 339 | ;; |
| 340 | *) |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 341 | echo "ssh: $1 $2 git-upload-pack '$3' $4" |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 342 | esac |
| 343 | } >"$TRASH_DIRECTORY/ssh-expect" && |
| 344 | (cd "$TRASH_DIRECTORY" && test_cmp ssh-expect ssh-output) |
| 345 | } |
| 346 | |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 347 | test_expect_success 'clone myhost:src uses ssh' ' |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 348 | git clone myhost:src ssh-clone && |
| 349 | expect_ssh myhost src |
| 350 | ' |
| 351 | |
Junio C Hamano | f57a871 | 2014-07-21 15:09:27 -0700 | [diff] [blame] | 352 | test_expect_success !MINGW,!CYGWIN 'clone local path foo:bar' ' |
Nguyễn Thái Ngọc Duy | 6000334 | 2013-05-04 09:19:33 +0700 | [diff] [blame] | 353 | cp -R src "foo:bar" && |
Torsten Bögershausen | 710eb3e | 2013-11-28 20:53:47 +0100 | [diff] [blame] | 354 | git clone "foo:bar" foobar && |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 355 | expect_ssh none |
| 356 | ' |
| 357 | |
| 358 | test_expect_success 'bracketed hostnames are still ssh' ' |
Nguyễn Thái Ngọc Duy | 8d3d28f | 2013-09-27 20:48:13 +0700 | [diff] [blame] | 359 | git clone "[myhost:123]:src" ssh-bracket-clone && |
brian m. carlson | d1018c2 | 2015-04-26 20:30:11 +0000 | [diff] [blame] | 360 | expect_ssh "-p 123" myhost src |
Nguyễn Thái Ngọc Duy | 6000334 | 2013-05-04 09:19:33 +0700 | [diff] [blame] | 361 | ' |
| 362 | |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 363 | test_expect_success 'OpenSSH variant passes -4' ' |
| 364 | git clone -4 "[myhost:123]:src" ssh-ipv4-clone && |
| 365 | expect_ssh "-4 -p 123" myhost src |
| 366 | ' |
| 367 | |
Jonathan Nieder | a3f5b66 | 2017-11-20 13:30:30 -0800 | [diff] [blame] | 368 | test_expect_success 'variant can be overridden' ' |
| 369 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/putty" && |
| 370 | git -c ssh.variant=putty clone -4 "[myhost:123]:src" ssh-putty-clone && |
| 371 | expect_ssh "-4 -P 123" myhost src |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 372 | ' |
| 373 | |
Jonathan Nieder | 0da0e49 | 2017-11-20 13:30:04 -0800 | [diff] [blame] | 374 | test_expect_success 'variant=auto picks based on basename' ' |
| 375 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
| 376 | git -c ssh.variant=auto clone -4 "[myhost:123]:src" ssh-auto-clone && |
| 377 | expect_ssh "-4 -P 123" myhost src |
| 378 | ' |
| 379 | |
Jonathan Nieder | a3f5b66 | 2017-11-20 13:30:30 -0800 | [diff] [blame] | 380 | test_expect_success 'simple does not support -4/-6' ' |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 381 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/simple" && |
Jonathan Nieder | 3fa5e0d | 2017-11-20 13:31:01 -0800 | [diff] [blame] | 382 | test_must_fail git clone -4 "myhost:src" ssh-4-clone-simple |
| 383 | ' |
| 384 | |
| 385 | test_expect_success 'simple does not support port' ' |
| 386 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/simple" && |
| 387 | test_must_fail git clone "[myhost:123]:src" ssh-bracket-clone-simple |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 388 | ' |
| 389 | |
| 390 | test_expect_success 'uplink is treated as simple' ' |
brian m. carlson | baaf233 | 2015-04-26 20:30:12 +0000 | [diff] [blame] | 391 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/uplink" && |
Jonathan Nieder | 3fa5e0d | 2017-11-20 13:31:01 -0800 | [diff] [blame] | 392 | test_must_fail git clone "[myhost:123]:src" ssh-bracket-clone-uplink && |
| 393 | git clone "myhost:src" ssh-clone-uplink && |
Brandon Williams | 94b8ae5 | 2017-10-16 10:55:31 -0700 | [diff] [blame] | 394 | expect_ssh myhost src |
brian m. carlson | baaf233 | 2015-04-26 20:30:12 +0000 | [diff] [blame] | 395 | ' |
| 396 | |
Jonathan Nieder | 0da0e49 | 2017-11-20 13:30:04 -0800 | [diff] [blame] | 397 | test_expect_success 'OpenSSH-like uplink is treated as ssh' ' |
| 398 | write_script "$TRASH_DIRECTORY/uplink" <<-EOF && |
| 399 | if test "\$1" = "-G" |
| 400 | then |
| 401 | exit 0 |
| 402 | fi && |
| 403 | exec "\$TRASH_DIRECTORY/ssh$X" "\$@" |
| 404 | EOF |
| 405 | test_when_finished "rm -f \"\$TRASH_DIRECTORY/uplink\"" && |
| 406 | GIT_SSH="$TRASH_DIRECTORY/uplink" && |
| 407 | test_when_finished "GIT_SSH=\"\$TRASH_DIRECTORY/ssh\$X\"" && |
| 408 | git clone "[myhost:123]:src" ssh-bracket-clone-sshlike-uplink && |
| 409 | expect_ssh "-p 123" myhost src |
| 410 | ' |
| 411 | |
brian m. carlson | baaf233 | 2015-04-26 20:30:12 +0000 | [diff] [blame] | 412 | test_expect_success 'plink is treated specially (as putty)' ' |
| 413 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
| 414 | git clone "[myhost:123]:src" ssh-bracket-clone-plink-0 && |
| 415 | expect_ssh "-P 123" myhost src |
| 416 | ' |
| 417 | |
| 418 | test_expect_success 'plink.exe is treated specially (as putty)' ' |
| 419 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" && |
| 420 | git clone "[myhost:123]:src" ssh-bracket-clone-plink-1 && |
| 421 | expect_ssh "-P 123" myhost src |
| 422 | ' |
| 423 | |
| 424 | test_expect_success 'tortoiseplink is like putty, with extra arguments' ' |
| 425 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/tortoiseplink" && |
| 426 | git clone "[myhost:123]:src" ssh-bracket-clone-plink-2 && |
| 427 | expect_ssh "-batch -P 123" myhost src |
| 428 | ' |
| 429 | |
Segev Finer | e9d9a8a | 2017-01-02 13:09:03 +0100 | [diff] [blame] | 430 | test_expect_success 'double quoted plink.exe in GIT_SSH_COMMAND' ' |
| 431 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" && |
| 432 | GIT_SSH_COMMAND="\"$TRASH_DIRECTORY/plink.exe\" -v" \ |
| 433 | git clone "[myhost:123]:src" ssh-bracket-clone-plink-3 && |
| 434 | expect_ssh "-v -P 123" myhost src |
| 435 | ' |
| 436 | |
| 437 | SQ="'" |
| 438 | test_expect_success 'single quoted plink.exe in GIT_SSH_COMMAND' ' |
| 439 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink.exe" && |
| 440 | GIT_SSH_COMMAND="$SQ$TRASH_DIRECTORY/plink.exe$SQ -v" \ |
| 441 | git clone "[myhost:123]:src" ssh-bracket-clone-plink-4 && |
| 442 | expect_ssh "-v -P 123" myhost src |
| 443 | ' |
| 444 | |
Segev Finer | dd33e07 | 2017-02-01 13:01:16 +0100 | [diff] [blame] | 445 | test_expect_success 'GIT_SSH_VARIANT overrides plink detection' ' |
| 446 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
| 447 | GIT_SSH_VARIANT=ssh \ |
| 448 | git clone "[myhost:123]:src" ssh-bracket-clone-variant-1 && |
| 449 | expect_ssh "-p 123" myhost src |
| 450 | ' |
| 451 | |
| 452 | test_expect_success 'ssh.variant overrides plink detection' ' |
| 453 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
| 454 | git -c ssh.variant=ssh \ |
| 455 | clone "[myhost:123]:src" ssh-bracket-clone-variant-2 && |
| 456 | expect_ssh "-p 123" myhost src |
| 457 | ' |
| 458 | |
| 459 | test_expect_success 'GIT_SSH_VARIANT overrides plink detection to plink' ' |
Jonathan Nieder | 8339805 | 2017-11-20 17:49:19 -0800 | [diff] [blame] | 460 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
Segev Finer | dd33e07 | 2017-02-01 13:01:16 +0100 | [diff] [blame] | 461 | GIT_SSH_VARIANT=plink \ |
| 462 | git clone "[myhost:123]:src" ssh-bracket-clone-variant-3 && |
| 463 | expect_ssh "-P 123" myhost src |
| 464 | ' |
| 465 | |
| 466 | test_expect_success 'GIT_SSH_VARIANT overrides plink to tortoiseplink' ' |
Jonathan Nieder | 8339805 | 2017-11-20 17:49:19 -0800 | [diff] [blame] | 467 | copy_ssh_wrapper_as "$TRASH_DIRECTORY/plink" && |
Segev Finer | dd33e07 | 2017-02-01 13:01:16 +0100 | [diff] [blame] | 468 | GIT_SSH_VARIANT=tortoiseplink \ |
| 469 | git clone "[myhost:123]:src" ssh-bracket-clone-variant-4 && |
| 470 | expect_ssh "-batch -P 123" myhost src |
| 471 | ' |
| 472 | |
Jeff King | 22e5ae5 | 2017-04-10 20:30:23 -0400 | [diff] [blame] | 473 | test_expect_success 'clean failure on broken quoting' ' |
| 474 | test_must_fail \ |
| 475 | env GIT_SSH_COMMAND="${SQ}plink.exe -v" \ |
| 476 | git clone "[myhost:123]:src" sq-failure |
| 477 | ' |
| 478 | |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 479 | counter=0 |
| 480 | # $1 url |
| 481 | # $2 none|host |
| 482 | # $3 path |
| 483 | test_clone_url () { |
| 484 | counter=$(($counter + 1)) |
| 485 | test_might_fail git clone "$1" tmp$counter && |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 486 | shift && |
| 487 | expect_ssh "$@" |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 488 | } |
| 489 | |
Torsten Bögershausen | 1cadad6 | 2018-12-15 05:33:30 +0100 | [diff] [blame] | 490 | test_expect_success !MINGW,!CYGWIN 'clone c:temp is ssl' ' |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 491 | test_clone_url c:temp c temp |
| 492 | ' |
| 493 | |
| 494 | test_expect_success MINGW 'clone c:temp is dos drive' ' |
| 495 | test_clone_url c:temp none |
| 496 | ' |
| 497 | |
| 498 | #ip v4 |
Torsten Bögershausen | 6a59974 | 2013-11-28 20:49:38 +0100 | [diff] [blame] | 499 | for repo in rep rep/home/project 123 |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 500 | do |
| 501 | test_expect_success "clone host:$repo" ' |
| 502 | test_clone_url host:$repo host $repo |
| 503 | ' |
| 504 | done |
| 505 | |
| 506 | #ipv6 |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 507 | for repo in rep rep/home/project 123 |
| 508 | do |
| 509 | test_expect_success "clone [::1]:$repo" ' |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 510 | test_clone_url [::1]:$repo ::1 "$repo" |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 511 | ' |
| 512 | done |
Torsten Bögershausen | c59ab2e | 2013-11-28 20:50:03 +0100 | [diff] [blame] | 513 | #home directory |
| 514 | test_expect_success "clone host:/~repo" ' |
| 515 | test_clone_url host:/~repo host "~repo" |
| 516 | ' |
| 517 | |
| 518 | test_expect_success "clone [::1]:/~repo" ' |
| 519 | test_clone_url [::1]:/~repo ::1 "~repo" |
| 520 | ' |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 521 | |
| 522 | # Corner cases |
Torsten Bögershausen | 83b0587 | 2013-11-28 20:49:54 +0100 | [diff] [blame] | 523 | for url in foo/bar:baz [foo]bar/baz:qux [foo/bar]:baz |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 524 | do |
| 525 | test_expect_success "clone $url is not ssh" ' |
| 526 | test_clone_url $url none |
| 527 | ' |
| 528 | done |
| 529 | |
| 530 | #with ssh:// scheme |
Torsten Bögershausen | 6b6c5f7 | 2015-04-07 22:03:25 +0200 | [diff] [blame] | 531 | #ignore trailing colon |
| 532 | for tcol in "" : |
| 533 | do |
| 534 | test_expect_success "clone ssh://host.xz$tcol/home/user/repo" ' |
| 535 | test_clone_url "ssh://host.xz$tcol/home/user/repo" host.xz /home/user/repo |
| 536 | ' |
| 537 | # from home directory |
| 538 | test_expect_success "clone ssh://host.xz$tcol/~repo" ' |
| 539 | test_clone_url "ssh://host.xz$tcol/~repo" host.xz "~repo" |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 540 | ' |
Torsten Bögershausen | 6b6c5f7 | 2015-04-07 22:03:25 +0200 | [diff] [blame] | 541 | done |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 542 | |
| 543 | # with port number |
| 544 | test_expect_success 'clone ssh://host.xz:22/home/user/repo' ' |
| 545 | test_clone_url "ssh://host.xz:22/home/user/repo" "-p 22 host.xz" "/home/user/repo" |
| 546 | ' |
| 547 | |
| 548 | # from home directory with port number |
| 549 | test_expect_success 'clone ssh://host.xz:22/~repo' ' |
| 550 | test_clone_url "ssh://host.xz:22/~repo" "-p 22 host.xz" "~repo" |
| 551 | ' |
| 552 | |
| 553 | #IPv6 |
Torsten Bögershausen | 6b6c5f7 | 2015-04-07 22:03:25 +0200 | [diff] [blame] | 554 | for tuah in ::1 [::1] [::1]: user@::1 user@[::1] user@[::1]: [user@::1] [user@::1]: |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 555 | do |
Torsten Bögershausen | a75a308 | 2016-05-09 19:53:12 +0200 | [diff] [blame] | 556 | ehost=$(echo $tuah | sed -e "s/1]:/1]/" | tr -d "[]") |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 557 | test_expect_success "clone ssh://$tuah/home/user/repo" " |
| 558 | test_clone_url ssh://$tuah/home/user/repo $ehost /home/user/repo |
| 559 | " |
| 560 | done |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 561 | |
| 562 | #IPv6 from home directory |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 563 | for tuah in ::1 [::1] user@::1 user@[::1] [user@::1] |
| 564 | do |
| 565 | euah=$(echo $tuah | tr -d "[]") |
| 566 | test_expect_success "clone ssh://$tuah/~repo" " |
| 567 | test_clone_url ssh://$tuah/~repo $euah '~repo' |
| 568 | " |
| 569 | done |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 570 | |
| 571 | #IPv6 with port number |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 572 | for tuah in [::1] user@[::1] [user@::1] |
| 573 | do |
| 574 | euah=$(echo $tuah | tr -d "[]") |
| 575 | test_expect_success "clone ssh://$tuah:22/home/user/repo" " |
| 576 | test_clone_url ssh://$tuah:22/home/user/repo '-p 22' $euah /home/user/repo |
| 577 | " |
| 578 | done |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 579 | |
| 580 | #IPv6 from home directory with port number |
Torsten Bögershausen | 9f69765 | 2015-02-21 16:53:01 +0100 | [diff] [blame] | 581 | for tuah in [::1] user@[::1] [user@::1] |
| 582 | do |
| 583 | euah=$(echo $tuah | tr -d "[]") |
| 584 | test_expect_success "clone ssh://$tuah:22/~repo" " |
| 585 | test_clone_url ssh://$tuah:22/~repo '-p 22' $euah '~repo' |
| 586 | " |
| 587 | done |
Torsten Bögershausen | 2171f3d | 2013-11-28 20:48:22 +0100 | [diff] [blame] | 588 | |
Junio C Hamano | 8b27722 | 2013-09-06 17:57:53 +0200 | [diff] [blame] | 589 | test_expect_success 'clone from a repository with two identical branches' ' |
| 590 | |
| 591 | ( |
| 592 | cd src && |
| 593 | git checkout -b another master |
| 594 | ) && |
| 595 | git clone src target-11 && |
| 596 | test "z$( cd target-11 && git symbolic-ref HEAD )" = zrefs/heads/another |
| 597 | |
| 598 | ' |
| 599 | |
Nguyễn Thái Ngọc Duy | 0d7d285 | 2013-12-05 20:02:53 +0700 | [diff] [blame] | 600 | test_expect_success 'shallow clone locally' ' |
| 601 | git clone --depth=1 --no-local src ssrrcc && |
| 602 | git clone ssrrcc ddsstt && |
| 603 | test_cmp ssrrcc/.git/shallow ddsstt/.git/shallow && |
| 604 | ( cd ddsstt && git fsck ) |
| 605 | ' |
| 606 | |
Jeff King | 3235983 | 2015-06-16 13:23:20 -0400 | [diff] [blame] | 607 | test_expect_success 'GIT_TRACE_PACKFILE produces a usable pack' ' |
| 608 | rm -rf dst.git && |
| 609 | GIT_TRACE_PACKFILE=$PWD/tmp.pack git clone --no-local --bare src dst.git && |
| 610 | git init --bare replay.git && |
| 611 | git -C replay.git index-pack -v --stdin <tmp.pack |
| 612 | ' |
| 613 | |
Eric Sunshine | b6947af | 2018-01-21 03:07:28 -0500 | [diff] [blame] | 614 | hex2oct () { |
| 615 | perl -ne 'printf "\\%03o", hex for /../g' |
| 616 | } |
| 617 | |
| 618 | test_expect_success 'clone on case-insensitive fs' ' |
| 619 | git init icasefs && |
| 620 | ( |
Eric Sunshine | 51b8547 | 2018-07-01 20:24:01 -0400 | [diff] [blame] | 621 | cd icasefs && |
Eric Sunshine | b6947af | 2018-01-21 03:07:28 -0500 | [diff] [blame] | 622 | o=$(git hash-object -w --stdin </dev/null | hex2oct) && |
| 623 | t=$(printf "100644 X\0${o}100644 x\0${o}" | |
| 624 | git hash-object -w -t tree --stdin) && |
| 625 | c=$(git commit-tree -m bogus $t) && |
| 626 | git update-ref refs/heads/bogus $c && |
Duy Nguyen | b878579 | 2018-08-17 20:00:39 +0200 | [diff] [blame] | 627 | git clone -b bogus . bogus 2>warning |
Eric Sunshine | b6947af | 2018-01-21 03:07:28 -0500 | [diff] [blame] | 628 | ) |
| 629 | ' |
| 630 | |
Torsten Bögershausen | a7f609e | 2018-11-22 18:59:52 +0100 | [diff] [blame] | 631 | test_expect_success CASE_INSENSITIVE_FS 'colliding file detection' ' |
Duy Nguyen | b878579 | 2018-08-17 20:00:39 +0200 | [diff] [blame] | 632 | grep X icasefs/warning && |
| 633 | grep x icasefs/warning && |
| 634 | test_i18ngrep "the following paths have collided" icasefs/warning |
| 635 | ' |
| 636 | |
Jonathan Tan | 548719f | 2017-12-08 15:58:46 +0000 | [diff] [blame] | 637 | partial_clone () { |
| 638 | SERVER="$1" && |
| 639 | URL="$2" && |
| 640 | |
| 641 | rm -rf "$SERVER" client && |
| 642 | test_create_repo "$SERVER" && |
| 643 | test_commit -C "$SERVER" one && |
| 644 | HASH1=$(git hash-object "$SERVER/one.t") && |
| 645 | git -C "$SERVER" revert HEAD && |
| 646 | test_commit -C "$SERVER" two && |
| 647 | HASH2=$(git hash-object "$SERVER/two.t") && |
| 648 | test_config -C "$SERVER" uploadpack.allowfilter 1 && |
| 649 | test_config -C "$SERVER" uploadpack.allowanysha1inwant 1 && |
| 650 | |
| 651 | git clone --filter=blob:limit=0 "$URL" client && |
| 652 | |
| 653 | git -C client fsck && |
| 654 | |
| 655 | # Ensure that unneeded blobs are not inadvertently fetched. |
| 656 | test_config -C client extensions.partialclone "not a remote" && |
| 657 | test_must_fail git -C client cat-file -e "$HASH1" && |
| 658 | |
| 659 | # But this blob was fetched, because clone performs an initial checkout |
| 660 | git -C client cat-file -e "$HASH2" |
| 661 | } |
| 662 | |
| 663 | test_expect_success 'partial clone' ' |
| 664 | partial_clone server "file://$(pwd)/server" |
| 665 | ' |
| 666 | |
| 667 | test_expect_success 'partial clone: warn if server does not support object filtering' ' |
| 668 | rm -rf server client && |
| 669 | test_create_repo server && |
| 670 | test_commit -C server one && |
| 671 | |
| 672 | git clone --filter=blob:limit=0 "file://$(pwd)/server" client 2> err && |
| 673 | |
| 674 | test_i18ngrep "filtering not recognized by server" err |
| 675 | ' |
| 676 | |
Jonathan Tan | c0c578b | 2017-12-08 15:58:47 +0000 | [diff] [blame] | 677 | test_expect_success 'batch missing blob request during checkout' ' |
| 678 | rm -rf server client && |
| 679 | |
| 680 | test_create_repo server && |
| 681 | echo a >server/a && |
| 682 | echo b >server/b && |
| 683 | git -C server add a b && |
| 684 | |
| 685 | git -C server commit -m x && |
| 686 | echo aa >server/a && |
| 687 | echo bb >server/b && |
| 688 | git -C server add a b && |
| 689 | git -C server commit -m x && |
| 690 | |
| 691 | test_config -C server uploadpack.allowfilter 1 && |
| 692 | test_config -C server uploadpack.allowanysha1inwant 1 && |
| 693 | |
| 694 | git clone --filter=blob:limit=0 "file://$(pwd)/server" client && |
| 695 | |
| 696 | # Ensure that there is only one negotiation by checking that there is |
| 697 | # only "done" line sent. ("done" marks the end of negotiation.) |
| 698 | GIT_TRACE_PACKET="$(pwd)/trace" git -C client checkout HEAD^ && |
| 699 | grep "git> done" trace >done_lines && |
| 700 | test_line_count = 1 done_lines |
| 701 | ' |
| 702 | |
| 703 | test_expect_success 'batch missing blob request does not inadvertently try to fetch gitlinks' ' |
| 704 | rm -rf server client && |
| 705 | |
| 706 | test_create_repo repo_for_submodule && |
| 707 | test_commit -C repo_for_submodule x && |
| 708 | |
| 709 | test_create_repo server && |
| 710 | echo a >server/a && |
| 711 | echo b >server/b && |
| 712 | git -C server add a b && |
| 713 | git -C server commit -m x && |
| 714 | |
| 715 | echo aa >server/a && |
| 716 | echo bb >server/b && |
| 717 | # Also add a gitlink pointing to an arbitrary repository |
| 718 | git -C server submodule add "$(pwd)/repo_for_submodule" c && |
| 719 | git -C server add a b c && |
| 720 | git -C server commit -m x && |
| 721 | |
| 722 | test_config -C server uploadpack.allowfilter 1 && |
| 723 | test_config -C server uploadpack.allowanysha1inwant 1 && |
| 724 | |
| 725 | # Make sure that it succeeds |
| 726 | git clone --filter=blob:limit=0 "file://$(pwd)/server" client |
| 727 | ' |
| 728 | |
Jonathan Tan | 548719f | 2017-12-08 15:58:46 +0000 | [diff] [blame] | 729 | . "$TEST_DIRECTORY"/lib-httpd.sh |
| 730 | start_httpd |
| 731 | |
| 732 | test_expect_success 'partial clone using HTTP' ' |
| 733 | partial_clone "$HTTPD_DOCUMENT_ROOT_PATH/server" "$HTTPD_URL/smart/server" |
| 734 | ' |
| 735 | |
| 736 | stop_httpd |
| 737 | |
Junio C Hamano | a2b26ac | 2008-04-23 10:53:47 -0700 | [diff] [blame] | 738 | test_done |