@matheusbsbs / matheus-bagliano / commits / b3f66fd3e3
Fork 0

setup: rework setup_explicit_git_dir()

This function is the most complex one among the three setup_* functions because all GIT_DIR, GIT_WORK_TREE, core.worktree and core.bare are involved. Because core.worktree is only effective inside setup_explicit_git_dir() and the extra code in setup_git_directory() is to handle that. The extra code can now be retired. Also note that setup_explicit assignment is removed, worktree setting is no longer decided by get_git_work_tree(). get_git_work_tree() will be simplified in the next commit. Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Nguyễn Thái Ngọc Duy committed Nov 26, 2010 at 22:32 UTC b3f66fd3e3abeb9183f33f023727e3a53868849d
2 files changed +221 -203
setup.c
+78 -60
@@ -208,24 +208,6 @@ int is_inside_work_tree(void)
208 return inside_work_tree;
209 }
210
211 -/*
212 - * set_work_tree() is only ever called if you set GIT_DIR explicitly.
213 - * The old behaviour (which we retain here) is to set the work tree root
214 - * to the cwd, unless overridden by the config, the command line, or
215 - * GIT_WORK_TREE.
216 - */
217 -static const char *set_work_tree(const char *dir)
218 -{
219 - char buffer[PATH_MAX + 1];
220 -
221 - if (!getcwd(buffer, sizeof(buffer)))
222 - die ("Could not get the current working directory");
223 - git_work_tree_cfg = xstrdup(buffer);
224 - inside_work_tree = 1;
225 -
226 - return NULL;
227 -}
228 -
211 void setup_work_tree(void)
212 {
213 const char *work_tree, *git_dir;
@@ -326,40 +308,92 @@ const char *read_gitfile_gently(const char *path)
308 }
309
310 static const char *setup_explicit_git_dir(const char *gitdirenv,
329 - const char *work_tree_env, int *nongit_ok)
311 + char *cwd, int len,
312 + int *nongit_ok)
313 {
331 - static char buffer[1024 + 1];
332 - const char *retval;
314 + const char *work_tree_env = getenv(GIT_WORK_TREE_ENVIRONMENT);
315 + const char *worktree;
316 + char *gitfile;
317
334 - if (startup_info)
335 - startup_info->setup_explicit = 1;
318 if (PATH_MAX - 40 < strlen(gitdirenv))
319 die("'$%s' too big", GIT_DIR_ENVIRONMENT);
320 +
321 + gitfile = (char*)read_gitfile_gently(gitdirenv);
322 + if (gitfile) {
323 + gitfile = xstrdup(gitfile);
324 + gitdirenv = gitfile;
325 + }
326 +
327 if (!is_git_directory(gitdirenv)) {
328 if (nongit_ok) {
329 *nongit_ok = 1;
330 + free(gitfile);
331 return NULL;
332 }
333 die("Not a git repository: '%s'", gitdirenv);
334 }
345 - if (!work_tree_env) {
346 - retval = set_work_tree(gitdirenv);
347 - /* config may override worktree */
348 - if (check_repository_format_gently(gitdirenv, nongit_ok))
349 - return NULL;
350 - return retval;
335 +
336 + if (check_repository_format_gently(gitdirenv, nongit_ok)) {
337 + free(gitfile);
338 + return NULL;
339 }
352 - if (check_repository_format_gently(gitdirenv, nongit_ok))
340 +
341 + /* #3, #7, #11, #15, #19, #23, #27, #31 (see t1510) */
342 + if (work_tree_env)
343 + set_git_work_tree(work_tree_env);
344 + else if (is_bare_repository_cfg > 0) {
345 + if (git_work_tree_cfg) /* #22.2, #30 */
346 + die("core.bare and core.worktree do not make sense");
347 +
348 + /* #18, #26 */
349 + set_git_dir(gitdirenv);
350 + free(gitfile);
351 return NULL;
354 - retval = get_relative_cwd(buffer, sizeof(buffer) - 1,
355 - get_git_work_tree());
356 - if (!retval || !*retval)
352 + }
353 + else if (git_work_tree_cfg) { /* #6, #14 */
354 + if (is_absolute_path(git_work_tree_cfg))
355 + set_git_work_tree(git_work_tree_cfg);
356 + else {
357 + char core_worktree[PATH_MAX];
358 + if (chdir(gitdirenv))
359 + die_errno("Could not chdir to '%s'", gitdirenv);
360 + if (chdir(git_work_tree_cfg))
361 + die_errno("Could not chdir to '%s'", git_work_tree_cfg);
362 + if (!getcwd(core_worktree, PATH_MAX))
363 + die_errno("Could not get directory '%s'", git_work_tree_cfg);
364 + if (chdir(cwd))
365 + die_errno("Could not come back to cwd");
366 + set_git_work_tree(core_worktree);
367 + }
368 + }
369 + else /* #2, #10 */
370 + set_git_work_tree(".");
371 +
372 + /* set_git_work_tree() must have been called by now */
373 + worktree = get_git_work_tree();
374 +
375 + /* both get_git_work_tree() and cwd are already normalized */
376 + if (!strcmp(cwd, worktree)) { /* cwd == worktree */
377 + set_git_dir(gitdirenv);
378 + free(gitfile);
379 return NULL;
358 - set_git_dir(make_absolute_path(gitdirenv));
359 - if (chdir(work_tree_env) < 0)
360 - die_errno ("Could not chdir to '%s'", work_tree_env);
361 - strcat(buffer, "/");
362 - return retval;
380 + }
381 +
382 + if (!prefixcmp(cwd, worktree) &&
383 + cwd[strlen(worktree)] == '/') { /* cwd inside worktree */
384 + set_git_dir(make_absolute_path(gitdirenv));
385 + if (chdir(worktree))
386 + die_errno("Could not chdir to '%s'", worktree);
387 + cwd[len++] = '/';
388 + cwd[len] = '\0';
389 + free(gitfile);
390 + return cwd + strlen(worktree) + 1;
391 + }
392 +
393 + /* cwd outside worktree */
394 + set_git_dir(gitdirenv);
395 + free(gitfile);
396 + return NULL;
397 }
398
399 static const char *setup_discovered_git_dir(const char *gitdir,
@@ -441,7 +475,6 @@ static dev_t get_device_or_die(const char *path, const char *prefix)
475 */
476 static const char *setup_git_directory_gently_1(int *nongit_ok)
477 {
444 - const char *work_tree_env = getenv(GIT_WORK_TREE_ENVIRONMENT);
478 const char *env_ceiling_dirs = getenv(CEILING_DIRECTORIES_ENVIRONMENT);
479 static char cwd[PATH_MAX+1];
480 const char *gitdirenv, *ret;
@@ -458,6 +491,10 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
491 if (nongit_ok)
492 *nongit_ok = 0;
493
494 + if (!getcwd(cwd, sizeof(cwd)-1))
495 + die_errno("Unable to read current working directory");
496 + offset = len = strlen(cwd);
497 +
498 /*
499 * If GIT_DIR is set explicitly, we're not going
500 * to do any discovery, but we still do repository
@@ -465,10 +502,7 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
502 */
503 gitdirenv = getenv(GIT_DIR_ENVIRONMENT);
504 if (gitdirenv)
468 - return setup_explicit_git_dir(gitdirenv, work_tree_env, nongit_ok);
469 -
470 - if (!getcwd(cwd, sizeof(cwd)-1))
471 - die_errno("Unable to read current working directory");
505 + return setup_explicit_git_dir(gitdirenv, cwd, len, nongit_ok);
506
507 ceil_offset = longest_ancestor_length(cwd, env_ceiling_dirs);
508 if (ceil_offset < 0 && has_dos_drive_prefix(cwd))
@@ -485,7 +519,6 @@ static const char *setup_git_directory_gently_1(int *nongit_ok)
519 * - ../../.git/
520 * etc.
521 */
488 - offset = len = strlen(cwd);
522 one_filesystem = !git_env_bool("GIT_DISCOVERY_ACROSS_FILESYSTEM", 0);
523 if (one_filesystem)
524 current_device = get_device_or_die(".", NULL);
@@ -628,20 +661,5 @@ int check_repository_format(void)
661 */
662 const char *setup_git_directory(void)
663 {
631 - const char *retval = setup_git_directory_gently(NULL);
632 -
633 - /* If the work tree is not the default one, recompute prefix */
634 - if ((!startup_info || startup_info->setup_explicit) &&
635 - inside_work_tree < 0) {
636 - static char buffer[PATH_MAX + 1];
637 - char *rel;
638 - if (retval && chdir(retval))
639 - die_errno ("Could not jump back into original cwd");
640 - rel = get_relative_cwd(buffer, PATH_MAX, get_git_work_tree());
641 - if (rel && *rel && chdir(get_git_work_tree()))
642 - die_errno ("Could not jump to working directory");
643 - return rel && *rel ? strcat(rel, "/") : NULL;
644 - }
645 -
646 - return retval;
664 + return setup_git_directory_gently(NULL);
665 }
t/t1510-repo-setup.sh
+143 -143
@@ -651,7 +651,7 @@ EOF
651 test_repo 6 "$TRASH_DIRECTORY/6/.git"
652 '
653
654 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=.. in subdir' '
654 +test_expect_success '#6: GIT_DIR(rel), core.worktree=.. in subdir' '
655 cat >6/sub/sub/expected <<EOF &&
656 setup: git_dir: $TRASH_DIRECTORY/6/.git
657 setup: worktree: $TRASH_DIRECTORY/6
@@ -662,7 +662,7 @@ EOF
662 test_repo 6/sub/sub ../../.git
663 '
664
665 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=..(rel) in subdir' '
665 +test_expect_success '#6: GIT_DIR(rel), core.worktree=..(rel) in subdir' '
666 cat >6/sub/sub/expected <<EOF &&
667 setup: git_dir: $TRASH_DIRECTORY/6/.git
668 setup: worktree: $TRASH_DIRECTORY/6
@@ -783,7 +783,7 @@ EOF
783 test_repo 6/sub/sub "$TRASH_DIRECTORY/6/.git"
784 '
785
786 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=../.. at root' '
786 +test_expect_success '#6: GIT_DIR(rel), core.worktree=../.. at root' '
787 cat >6/expected <<EOF &&
788 setup: git_dir: $TRASH_DIRECTORY/6/.git
789 setup: worktree: $TRASH_DIRECTORY
@@ -794,7 +794,7 @@ EOF
794 test_repo 6 .git
795 '
796
797 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=../..(rel) at root' '
797 +test_expect_success '#6: GIT_DIR(rel), core.worktree=../..(rel) at root' '
798 cat >6/expected <<EOF &&
799 setup: git_dir: $TRASH_DIRECTORY/6/.git
800 setup: worktree: $TRASH_DIRECTORY
@@ -827,7 +827,7 @@ EOF
827 test_repo 6 "$TRASH_DIRECTORY/6/.git"
828 '
829
830 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=../.. in subdir' '
830 +test_expect_success '#6: GIT_DIR(rel), core.worktree=../.. in subdir' '
831 cat >6/sub/sub/expected <<EOF &&
832 setup: git_dir: $TRASH_DIRECTORY/6/.git
833 setup: worktree: $TRASH_DIRECTORY
@@ -838,7 +838,7 @@ EOF
838 test_repo 6/sub/sub ../../.git
839 '
840
841 -test_expect_failure '#6: GIT_DIR(rel), core.worktree=../..(rel) in subdir' '
841 +test_expect_success '#6: GIT_DIR(rel), core.worktree=../..(rel) in subdir' '
842 cat >6/sub/sub/expected <<EOF &&
843 setup: git_dir: $TRASH_DIRECTORY/6/.git
844 setup: worktree: $TRASH_DIRECTORY
@@ -1260,7 +1260,7 @@ test_expect_success '#10: setup' '
1260 cd ..
1261 '
1262
1263 -test_expect_failure '#10: at root' '
1263 +test_expect_success '#10: at root' '
1264 cat >10/expected <<EOF &&
1265 setup: git_dir: $TRASH_DIRECTORY/10.git
1266 setup: worktree: $TRASH_DIRECTORY/10
@@ -1270,7 +1270,7 @@ EOF
1270 test_repo 10 "$TRASH_DIRECTORY/10/.git"
1271 '
1272
1273 -test_expect_failure '#10: in subdir' '
1273 +test_expect_success '#10: in subdir' '
1274 cat >10/sub/expected <<EOF &&
1275 setup: git_dir: $TRASH_DIRECTORY/10.git
1276 setup: worktree: $TRASH_DIRECTORY/10/sub
@@ -1280,7 +1280,7 @@ EOF
1280 test_repo 10/sub "$TRASH_DIRECTORY/10/.git"
1281 '
1282
1283 -test_expect_failure '#10: relative GIT_DIR at root' '
1283 +test_expect_success '#10: relative GIT_DIR at root' '
1284 cat >10/expected <<EOF &&
1285 setup: git_dir: $TRASH_DIRECTORY/10.git
1286 setup: worktree: $TRASH_DIRECTORY/10
@@ -1290,7 +1290,7 @@ EOF
1290 test_repo 10 .git
1291 '
1292
1293 -test_expect_failure '#10: relative GIT_DIR in subdir' '
1293 +test_expect_success '#10: relative GIT_DIR in subdir' '
1294 cat >10/sub/expected <<EOF &&
1295 setup: git_dir: $TRASH_DIRECTORY/10.git
1296 setup: worktree: $TRASH_DIRECTORY/10/sub
@@ -1327,7 +1327,7 @@ test_expect_success '#11: setup' '
1327 cd ..
1328 '
1329
1330 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
1330 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
1331 cat >11/expected <<EOF &&
1332 setup: git_dir: $TRASH_DIRECTORY/11.git
1333 setup: worktree: $TRASH_DIRECTORY/11
@@ -1337,7 +1337,7 @@ EOF
1337 test_repo 11 .git "$TRASH_DIRECTORY/11"
1338 '
1339
1340 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
1340 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
1341 cat >11/expected <<EOF &&
1342 setup: git_dir: $TRASH_DIRECTORY/11.git
1343 setup: worktree: $TRASH_DIRECTORY/11
@@ -1347,7 +1347,7 @@ EOF
1347 test_repo 11 .git .
1348 '
1349
1350 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=root at root' '
1350 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=root at root' '
1351 cat >11/expected <<EOF &&
1352 setup: git_dir: $TRASH_DIRECTORY/11.git
1353 setup: worktree: $TRASH_DIRECTORY/11
@@ -1357,7 +1357,7 @@ EOF
1357 test_repo 11 "$TRASH_DIRECTORY/11/.git" "$TRASH_DIRECTORY/11"
1358 '
1359
1360 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
1360 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
1361 cat >11/expected <<EOF &&
1362 setup: git_dir: $TRASH_DIRECTORY/11.git
1363 setup: worktree: $TRASH_DIRECTORY/11
@@ -1367,7 +1367,7 @@ EOF
1367 test_repo 11 "$TRASH_DIRECTORY/11/.git" .
1368 '
1369
1370 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
1370 +test_expect_success '#11: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
1371 cat >11/sub/sub/expected <<EOF &&
1372 setup: git_dir: $TRASH_DIRECTORY/11.git
1373 setup: worktree: $TRASH_DIRECTORY/11
@@ -1377,7 +1377,7 @@ EOF
1377 test_repo 11/sub/sub ../../.git "$TRASH_DIRECTORY/11"
1378 '
1379
1380 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
1380 +test_expect_success '#11: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
1381 cat >11/sub/sub/expected <<EOF &&
1382 setup: git_dir: $TRASH_DIRECTORY/11.git
1383 setup: worktree: $TRASH_DIRECTORY/11
@@ -1387,7 +1387,7 @@ EOF
1387 test_repo 11/sub/sub ../../.git ../..
1388 '
1389
1390 -test_expect_failure '#11: GIT_DIR, GIT_WORKTREE=root in subdir' '
1390 +test_expect_success '#11: GIT_DIR, GIT_WORKTREE=root in subdir' '
1391 cat >11/sub/expected <<EOF &&
1392 setup: git_dir: $TRASH_DIRECTORY/11.git
1393 setup: worktree: $TRASH_DIRECTORY/11
@@ -1397,7 +1397,7 @@ EOF
1397 test_repo 11/sub "$TRASH_DIRECTORY/11/.git" "$TRASH_DIRECTORY/11"
1398 '
1399
1400 -test_expect_failure '#11: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
1400 +test_expect_success '#11: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
1401 cat >11/sub/sub/expected <<EOF &&
1402 setup: git_dir: $TRASH_DIRECTORY/11.git
1403 setup: worktree: $TRASH_DIRECTORY/11
@@ -1407,7 +1407,7 @@ EOF
1407 test_repo 11/sub/sub "$TRASH_DIRECTORY/11/.git" ../..
1408 '
1409
1410 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
1410 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
1411 cat >11/expected <<EOF &&
1412 setup: git_dir: $TRASH_DIRECTORY/11.git
1413 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1417,7 +1417,7 @@ EOF
1417 test_repo 11 .git "$TRASH_DIRECTORY/11/wt"
1418 '
1419
1420 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
1420 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
1421 cat >11/expected <<EOF &&
1422 setup: git_dir: $TRASH_DIRECTORY/11.git
1423 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1427,7 +1427,7 @@ EOF
1427 test_repo 11 .git wt
1428 '
1429
1430 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
1430 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
1431 cat >11/expected <<EOF &&
1432 setup: git_dir: $TRASH_DIRECTORY/11.git
1433 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1437,7 +1437,7 @@ EOF
1437 test_repo 11 "$TRASH_DIRECTORY/11/.git" wt
1438 '
1439
1440 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=wt at root' '
1440 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=wt at root' '
1441 cat >11/expected <<EOF &&
1442 setup: git_dir: $TRASH_DIRECTORY/11.git
1443 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1447,7 +1447,7 @@ EOF
1447 test_repo 11 "$TRASH_DIRECTORY/11/.git" "$TRASH_DIRECTORY/11/wt"
1448 '
1449
1450 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
1450 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
1451 cat >11/sub/sub/expected <<EOF &&
1452 setup: git_dir: $TRASH_DIRECTORY/11.git
1453 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1457,7 +1457,7 @@ EOF
1457 test_repo 11/sub/sub ../../.git "$TRASH_DIRECTORY/11/wt"
1458 '
1459
1460 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
1460 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
1461 cat >11/sub/sub/expected <<EOF &&
1462 setup: git_dir: $TRASH_DIRECTORY/11.git
1463 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1467,7 +1467,7 @@ EOF
1467 test_repo 11/sub/sub ../../.git ../../wt
1468 '
1469
1470 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
1470 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
1471 cat >11/sub/sub/expected <<EOF &&
1472 setup: git_dir: $TRASH_DIRECTORY/11.git
1473 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1477,7 +1477,7 @@ EOF
1477 test_repo 11/sub/sub "$TRASH_DIRECTORY/11/.git" ../../wt
1478 '
1479
1480 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
1480 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
1481 cat >11/sub/sub/expected <<EOF &&
1482 setup: git_dir: $TRASH_DIRECTORY/11.git
1483 setup: worktree: $TRASH_DIRECTORY/11/wt
@@ -1487,7 +1487,7 @@ EOF
1487 test_repo 11/sub/sub "$TRASH_DIRECTORY/11/.git" "$TRASH_DIRECTORY/11/wt"
1488 '
1489
1490 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
1490 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
1491 cat >11/expected <<EOF &&
1492 setup: git_dir: $TRASH_DIRECTORY/11.git
1493 setup: worktree: $TRASH_DIRECTORY
@@ -1497,7 +1497,7 @@ EOF
1497 test_repo 11 .git "$TRASH_DIRECTORY"
1498 '
1499
1500 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
1500 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
1501 cat >11/expected <<EOF &&
1502 setup: git_dir: $TRASH_DIRECTORY/11.git
1503 setup: worktree: $TRASH_DIRECTORY
@@ -1507,7 +1507,7 @@ EOF
1507 test_repo 11 .git ..
1508 '
1509
1510 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
1510 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
1511 cat >11/expected <<EOF &&
1512 setup: git_dir: $TRASH_DIRECTORY/11.git
1513 setup: worktree: $TRASH_DIRECTORY
@@ -1517,7 +1517,7 @@ EOF
1517 test_repo 11 "$TRASH_DIRECTORY/11/.git" ..
1518 '
1519
1520 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=.. at root' '
1520 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=.. at root' '
1521 cat >11/expected <<EOF &&
1522 setup: git_dir: $TRASH_DIRECTORY/11.git
1523 setup: worktree: $TRASH_DIRECTORY
@@ -1527,7 +1527,7 @@ EOF
1527 test_repo 11 "$TRASH_DIRECTORY/11/.git" "$TRASH_DIRECTORY"
1528 '
1529
1530 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
1530 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
1531 cat >11/sub/sub/expected <<EOF &&
1532 setup: git_dir: $TRASH_DIRECTORY/11.git
1533 setup: worktree: $TRASH_DIRECTORY
@@ -1537,7 +1537,7 @@ EOF
1537 test_repo 11/sub/sub ../../.git "$TRASH_DIRECTORY"
1538 '
1539
1540 -test_expect_failure '#11: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
1540 +test_expect_success '#11: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
1541 cat >11/sub/sub/expected <<EOF &&
1542 setup: git_dir: $TRASH_DIRECTORY/11.git
1543 setup: worktree: $TRASH_DIRECTORY
@@ -1547,7 +1547,7 @@ EOF
1547 test_repo 11/sub/sub ../../.git ../../..
1548 '
1549
1550 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
1550 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
1551 cat >11/sub/sub/expected <<EOF &&
1552 setup: git_dir: $TRASH_DIRECTORY/11.git
1553 setup: worktree: $TRASH_DIRECTORY
@@ -1557,7 +1557,7 @@ EOF
1557 test_repo 11/sub/sub "$TRASH_DIRECTORY/11/.git" ../../../
1558 '
1559
1560 -test_expect_failure '#11: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
1560 +test_expect_success '#11: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
1561 cat >11/sub/sub/expected <<EOF &&
1562 setup: git_dir: $TRASH_DIRECTORY/11.git
1563 setup: worktree: $TRASH_DIRECTORY
@@ -1693,7 +1693,7 @@ test_expect_success '#14: setup' '
1693 cd ..
1694 '
1695
1696 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14 at root' '
1696 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14 at root' '
1697 cat >14/expected <<EOF &&
1698 setup: git_dir: $TRASH_DIRECTORY/14.git
1699 setup: worktree: $TRASH_DIRECTORY/14
@@ -1704,7 +1704,7 @@ EOF
1704 test_repo 14 .git
1705 '
1706
1707 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14(rel) at root' '
1707 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14(rel) at root' '
1708 cat >14/expected <<EOF &&
1709 setup: git_dir: $TRASH_DIRECTORY/14.git
1710 setup: worktree: $TRASH_DIRECTORY/14
@@ -1715,7 +1715,7 @@ EOF
1715 test_repo 14 .git
1716 '
1717
1718 -test_expect_failure '#14: GIT_DIR, core.worktree=../14 at root' '
1718 +test_expect_success '#14: GIT_DIR, core.worktree=../14 at root' '
1719 cat >14/expected <<EOF &&
1720 setup: git_dir: $TRASH_DIRECTORY/14.git
1721 setup: worktree: $TRASH_DIRECTORY/14
@@ -1726,7 +1726,7 @@ EOF
1726 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1727 '
1728
1729 -test_expect_failure '#14: GIT_DIR, core.worktree=../14(rel) at root' '
1729 +test_expect_success '#14: GIT_DIR, core.worktree=../14(rel) at root' '
1730 cat >14/expected <<EOF &&
1731 setup: git_dir: $TRASH_DIRECTORY/14.git
1732 setup: worktree: $TRASH_DIRECTORY/14
@@ -1737,7 +1737,7 @@ EOF
1737 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1738 '
1739
1740 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14 in subdir' '
1740 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14 in subdir' '
1741 cat >14/sub/sub/expected <<EOF &&
1742 setup: git_dir: $TRASH_DIRECTORY/14.git
1743 setup: worktree: $TRASH_DIRECTORY/14
@@ -1748,7 +1748,7 @@ EOF
1748 test_repo 14/sub/sub ../../.git
1749 '
1750
1751 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14(rel) in subdir' '
1751 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14(rel) in subdir' '
1752 cat >14/sub/sub/expected <<EOF &&
1753 setup: git_dir: $TRASH_DIRECTORY/14.git
1754 setup: worktree: $TRASH_DIRECTORY/14
@@ -1759,7 +1759,7 @@ EOF
1759 test_repo 14/sub/sub ../../.git
1760 '
1761
1762 -test_expect_failure '#14: GIT_DIR, core.worktree=../14 in subdir' '
1762 +test_expect_success '#14: GIT_DIR, core.worktree=../14 in subdir' '
1763 cat >14/sub/expected <<EOF &&
1764 setup: git_dir: $TRASH_DIRECTORY/14.git
1765 setup: worktree: $TRASH_DIRECTORY/14
@@ -1770,7 +1770,7 @@ EOF
1770 test_repo 14/sub "$TRASH_DIRECTORY/14/.git"
1771 '
1772
1773 -test_expect_failure '#14: GIT_DIR, core.worktree=../14(rel) in subdir' '
1773 +test_expect_success '#14: GIT_DIR, core.worktree=../14(rel) in subdir' '
1774 cat >14/sub/sub/expected <<EOF &&
1775 setup: git_dir: $TRASH_DIRECTORY/14.git
1776 setup: worktree: $TRASH_DIRECTORY/14
@@ -1781,7 +1781,7 @@ EOF
1781 test_repo 14/sub/sub "$TRASH_DIRECTORY/14/.git"
1782 '
1783
1784 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14/wt at root' '
1784 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14/wt at root' '
1785 cat >14/expected <<EOF &&
1786 setup: git_dir: $TRASH_DIRECTORY/14.git
1787 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1792,7 +1792,7 @@ EOF
1792 test_repo 14 .git
1793 '
1794
1795 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14/wt(rel) at root' '
1795 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14/wt(rel) at root' '
1796 cat >14/expected <<EOF &&
1797 setup: git_dir: $TRASH_DIRECTORY/14.git
1798 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1803,7 +1803,7 @@ EOF
1803 test_repo 14 .git
1804 '
1805
1806 -test_expect_failure '#14: GIT_DIR, core.worktree=../14/wt(rel) at root' '
1806 +test_expect_success '#14: GIT_DIR, core.worktree=../14/wt(rel) at root' '
1807 cat >14/expected <<EOF &&
1808 setup: git_dir: $TRASH_DIRECTORY/14.git
1809 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1814,7 +1814,7 @@ EOF
1814 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1815 '
1816
1817 -test_expect_failure '#14: GIT_DIR, core.worktree=../14/wt at root' '
1817 +test_expect_success '#14: GIT_DIR, core.worktree=../14/wt at root' '
1818 cat >14/expected <<EOF &&
1819 setup: git_dir: $TRASH_DIRECTORY/14.git
1820 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1825,7 +1825,7 @@ EOF
1825 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1826 '
1827
1828 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14/wt in subdir' '
1828 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14/wt in subdir' '
1829 cat >14/sub/sub/expected <<EOF &&
1830 setup: git_dir: $TRASH_DIRECTORY/14.git
1831 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1836,7 +1836,7 @@ EOF
1836 test_repo 14/sub/sub ../../.git
1837 '
1838
1839 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=../14/wt(rel) in subdir' '
1839 +test_expect_success '#14: GIT_DIR(rel), core.worktree=../14/wt(rel) in subdir' '
1840 cat >14/sub/sub/expected <<EOF &&
1841 setup: git_dir: $TRASH_DIRECTORY/14.git
1842 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1847,7 +1847,7 @@ EOF
1847 test_repo 14/sub/sub ../../.git
1848 '
1849
1850 -test_expect_failure '#14: GIT_DIR, core.worktree=../14/wt(rel) in subdir' '
1850 +test_expect_success '#14: GIT_DIR, core.worktree=../14/wt(rel) in subdir' '
1851 cat >14/sub/sub/expected <<EOF &&
1852 setup: git_dir: $TRASH_DIRECTORY/14.git
1853 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1858,7 +1858,7 @@ EOF
1858 test_repo 14/sub/sub "$TRASH_DIRECTORY/14/.git"
1859 '
1860
1861 -test_expect_failure '#14: GIT_DIR, core.worktree=../14/wt in subdir' '
1861 +test_expect_success '#14: GIT_DIR, core.worktree=../14/wt in subdir' '
1862 cat >14/sub/sub/expected <<EOF &&
1863 setup: git_dir: $TRASH_DIRECTORY/14.git
1864 setup: worktree: $TRASH_DIRECTORY/14/wt
@@ -1869,7 +1869,7 @@ EOF
1869 test_repo 14/sub/sub "$TRASH_DIRECTORY/14/.git"
1870 '
1871
1872 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=.. at root' '
1872 +test_expect_success '#14: GIT_DIR(rel), core.worktree=.. at root' '
1873 cat >14/expected <<EOF &&
1874 setup: git_dir: $TRASH_DIRECTORY/14.git
1875 setup: worktree: $TRASH_DIRECTORY
@@ -1880,7 +1880,7 @@ EOF
1880 test_repo 14 .git
1881 '
1882
1883 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=..(rel) at root' '
1883 +test_expect_success '#14: GIT_DIR(rel), core.worktree=..(rel) at root' '
1884 cat >14/expected <<EOF &&
1885 setup: git_dir: $TRASH_DIRECTORY/14.git
1886 setup: worktree: $TRASH_DIRECTORY
@@ -1891,7 +1891,7 @@ EOF
1891 test_repo 14 .git
1892 '
1893
1894 -test_expect_failure '#14: GIT_DIR, core.worktree=..(rel) at root' '
1894 +test_expect_success '#14: GIT_DIR, core.worktree=..(rel) at root' '
1895 cat >14/expected <<EOF &&
1896 setup: git_dir: $TRASH_DIRECTORY/14.git
1897 setup: worktree: $TRASH_DIRECTORY
@@ -1902,7 +1902,7 @@ EOF
1902 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1903 '
1904
1905 -test_expect_failure '#14: GIT_DIR, core.worktree=.. at root' '
1905 +test_expect_success '#14: GIT_DIR, core.worktree=.. at root' '
1906 cat >14/expected <<EOF &&
1907 setup: git_dir: $TRASH_DIRECTORY/14.git
1908 setup: worktree: $TRASH_DIRECTORY
@@ -1913,7 +1913,7 @@ EOF
1913 test_repo 14 "$TRASH_DIRECTORY/14/.git"
1914 '
1915
1916 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=.. in subdir' '
1916 +test_expect_success '#14: GIT_DIR(rel), core.worktree=.. in subdir' '
1917 cat >14/sub/sub/expected <<EOF &&
1918 setup: git_dir: $TRASH_DIRECTORY/14.git
1919 setup: worktree: $TRASH_DIRECTORY
@@ -1924,7 +1924,7 @@ EOF
1924 test_repo 14/sub/sub ../../.git
1925 '
1926
1927 -test_expect_failure '#14: GIT_DIR(rel), core.worktree=..(rel) in subdir' '
1927 +test_expect_success '#14: GIT_DIR(rel), core.worktree=..(rel) in subdir' '
1928 cat >14/sub/sub/expected <<EOF &&
1929 setup: git_dir: $TRASH_DIRECTORY/14.git
1930 setup: worktree: $TRASH_DIRECTORY
@@ -1935,7 +1935,7 @@ EOF
1935 test_repo 14/sub/sub ../../.git
1936 '
1937
1938 -test_expect_failure '#14: GIT_DIR, core.worktree=..(rel) in subdir' '
1938 +test_expect_success '#14: GIT_DIR, core.worktree=..(rel) in subdir' '
1939 cat >14/sub/sub/expected <<EOF &&
1940 setup: git_dir: $TRASH_DIRECTORY/14.git
1941 setup: worktree: $TRASH_DIRECTORY
@@ -1946,7 +1946,7 @@ EOF
1946 test_repo 14/sub/sub "$TRASH_DIRECTORY/14/.git"
1947 '
1948
1949 -test_expect_failure '#14: GIT_DIR, core.worktree=.. in subdir' '
1949 +test_expect_success '#14: GIT_DIR, core.worktree=.. in subdir' '
1950 cat >14/sub/sub/expected <<EOF &&
1951 setup: git_dir: $TRASH_DIRECTORY/14.git
1952 setup: worktree: $TRASH_DIRECTORY
@@ -1985,7 +1985,7 @@ test_expect_success '#15: setup' '
1985 cd ..
1986 '
1987
1988 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
1988 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
1989 cat >15/expected <<EOF &&
1990 setup: git_dir: $TRASH_DIRECTORY/15.git
1991 setup: worktree: $TRASH_DIRECTORY/15
@@ -1995,7 +1995,7 @@ EOF
1995 test_repo 15 .git "$TRASH_DIRECTORY/15"
1996 '
1997
1998 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
1998 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
1999 cat >15/expected <<EOF &&
2000 setup: git_dir: $TRASH_DIRECTORY/15.git
2001 setup: worktree: $TRASH_DIRECTORY/15
@@ -2005,7 +2005,7 @@ EOF
2005 test_repo 15 .git .
2006 '
2007
2008 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=root at root' '
2008 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=root at root' '
2009 cat >15/expected <<EOF &&
2010 setup: git_dir: $TRASH_DIRECTORY/15.git
2011 setup: worktree: $TRASH_DIRECTORY/15
@@ -2015,7 +2015,7 @@ EOF
2015 test_repo 15 "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY/15"
2016 '
2017
2018 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
2018 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
2019 cat >15/expected <<EOF &&
2020 setup: git_dir: $TRASH_DIRECTORY/15.git
2021 setup: worktree: $TRASH_DIRECTORY/15
@@ -2025,7 +2025,7 @@ EOF
2025 test_repo 15 "$TRASH_DIRECTORY/15/.git" .
2026 '
2027
2028 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
2028 +test_expect_success '#15: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
2029 cat >15/sub/sub/expected <<EOF &&
2030 setup: git_dir: $TRASH_DIRECTORY/15.git
2031 setup: worktree: $TRASH_DIRECTORY/15
@@ -2035,7 +2035,7 @@ EOF
2035 test_repo 15/sub/sub ../../.git "$TRASH_DIRECTORY/15"
2036 '
2037
2038 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
2038 +test_expect_success '#15: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
2039 cat >15/sub/sub/expected <<EOF &&
2040 setup: git_dir: $TRASH_DIRECTORY/15.git
2041 setup: worktree: $TRASH_DIRECTORY/15
@@ -2045,7 +2045,7 @@ EOF
2045 test_repo 15/sub/sub ../../.git ../..
2046 '
2047
2048 -test_expect_failure '#15: GIT_DIR, GIT_WORKTREE=root in subdir' '
2048 +test_expect_success '#15: GIT_DIR, GIT_WORKTREE=root in subdir' '
2049 cat >15/sub/expected <<EOF &&
2050 setup: git_dir: $TRASH_DIRECTORY/15.git
2051 setup: worktree: $TRASH_DIRECTORY/15
@@ -2055,7 +2055,7 @@ EOF
2055 test_repo 15/sub "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY/15"
2056 '
2057
2058 -test_expect_failure '#15: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
2058 +test_expect_success '#15: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
2059 cat >15/sub/sub/expected <<EOF &&
2060 setup: git_dir: $TRASH_DIRECTORY/15.git
2061 setup: worktree: $TRASH_DIRECTORY/15
@@ -2065,7 +2065,7 @@ EOF
2065 test_repo 15/sub/sub "$TRASH_DIRECTORY/15/.git" ../..
2066 '
2067
2068 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
2068 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
2069 cat >15/expected <<EOF &&
2070 setup: git_dir: $TRASH_DIRECTORY/15.git
2071 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2075,7 +2075,7 @@ EOF
2075 test_repo 15 .git "$TRASH_DIRECTORY/15/wt"
2076 '
2077
2078 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
2078 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
2079 cat >15/expected <<EOF &&
2080 setup: git_dir: $TRASH_DIRECTORY/15.git
2081 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2085,7 +2085,7 @@ EOF
2085 test_repo 15 .git wt
2086 '
2087
2088 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
2088 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
2089 cat >15/expected <<EOF &&
2090 setup: git_dir: $TRASH_DIRECTORY/15.git
2091 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2095,7 +2095,7 @@ EOF
2095 test_repo 15 "$TRASH_DIRECTORY/15/.git" wt
2096 '
2097
2098 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=wt at root' '
2098 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=wt at root' '
2099 cat >15/expected <<EOF &&
2100 setup: git_dir: $TRASH_DIRECTORY/15.git
2101 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2105,7 +2105,7 @@ EOF
2105 test_repo 15 "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY/15/wt"
2106 '
2107
2108 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
2108 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
2109 cat >15/sub/sub/expected <<EOF &&
2110 setup: git_dir: $TRASH_DIRECTORY/15.git
2111 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2115,7 +2115,7 @@ EOF
2115 test_repo 15/sub/sub ../../.git "$TRASH_DIRECTORY/15/wt"
2116 '
2117
2118 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
2118 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
2119 cat >15/sub/sub/expected <<EOF &&
2120 setup: git_dir: $TRASH_DIRECTORY/15.git
2121 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2125,7 +2125,7 @@ EOF
2125 test_repo 15/sub/sub ../../.git ../../wt
2126 '
2127
2128 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
2128 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
2129 cat >15/sub/sub/expected <<EOF &&
2130 setup: git_dir: $TRASH_DIRECTORY/15.git
2131 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2135,7 +2135,7 @@ EOF
2135 test_repo 15/sub/sub "$TRASH_DIRECTORY/15/.git" ../../wt
2136 '
2137
2138 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
2138 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
2139 cat >15/sub/sub/expected <<EOF &&
2140 setup: git_dir: $TRASH_DIRECTORY/15.git
2141 setup: worktree: $TRASH_DIRECTORY/15/wt
@@ -2145,7 +2145,7 @@ EOF
2145 test_repo 15/sub/sub "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY/15/wt"
2146 '
2147
2148 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
2148 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
2149 cat >15/expected <<EOF &&
2150 setup: git_dir: $TRASH_DIRECTORY/15.git
2151 setup: worktree: $TRASH_DIRECTORY
@@ -2155,7 +2155,7 @@ EOF
2155 test_repo 15 .git "$TRASH_DIRECTORY"
2156 '
2157
2158 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
2158 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
2159 cat >15/expected <<EOF &&
2160 setup: git_dir: $TRASH_DIRECTORY/15.git
2161 setup: worktree: $TRASH_DIRECTORY
@@ -2165,7 +2165,7 @@ EOF
2165 test_repo 15 .git ..
2166 '
2167
2168 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
2168 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
2169 cat >15/expected <<EOF &&
2170 setup: git_dir: $TRASH_DIRECTORY/15.git
2171 setup: worktree: $TRASH_DIRECTORY
@@ -2175,7 +2175,7 @@ EOF
2175 test_repo 15 "$TRASH_DIRECTORY/15/.git" ..
2176 '
2177
2178 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=.. at root' '
2178 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=.. at root' '
2179 cat >15/expected <<EOF &&
2180 setup: git_dir: $TRASH_DIRECTORY/15.git
2181 setup: worktree: $TRASH_DIRECTORY
@@ -2185,7 +2185,7 @@ EOF
2185 test_repo 15 "$TRASH_DIRECTORY/15/.git" "$TRASH_DIRECTORY"
2186 '
2187
2188 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
2188 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
2189 cat >15/sub/sub/expected <<EOF &&
2190 setup: git_dir: $TRASH_DIRECTORY/15.git
2191 setup: worktree: $TRASH_DIRECTORY
@@ -2195,7 +2195,7 @@ EOF
2195 test_repo 15/sub/sub ../../.git "$TRASH_DIRECTORY"
2196 '
2197
2198 -test_expect_failure '#15: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
2198 +test_expect_success '#15: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
2199 cat >15/sub/sub/expected <<EOF &&
2200 setup: git_dir: $TRASH_DIRECTORY/15.git
2201 setup: worktree: $TRASH_DIRECTORY
@@ -2205,7 +2205,7 @@ EOF
2205 test_repo 15/sub/sub ../../.git ../../..
2206 '
2207
2208 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
2208 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
2209 cat >15/sub/sub/expected <<EOF &&
2210 setup: git_dir: $TRASH_DIRECTORY/15.git
2211 setup: worktree: $TRASH_DIRECTORY
@@ -2215,7 +2215,7 @@ EOF
2215 test_repo 15/sub/sub "$TRASH_DIRECTORY/15/.git" ../../../
2216 '
2217
2218 -test_expect_failure '#15: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
2218 +test_expect_success '#15: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
2219 cat >15/sub/sub/expected <<EOF &&
2220 setup: git_dir: $TRASH_DIRECTORY/15.git
2221 setup: worktree: $TRASH_DIRECTORY
@@ -3160,7 +3160,7 @@ EOF
3160 test_repo 22/.git "$TRASH_DIRECTORY/22/.git"
3161 '
3162
3163 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=. in .git/sub' '
3163 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=. in .git/sub' '
3164 cat >22/.git/sub/expected <<EOF &&
3165 setup: git_dir: $TRASH_DIRECTORY/22/.git
3166 setup: worktree: $TRASH_DIRECTORY/22/.git
@@ -3171,7 +3171,7 @@ EOF
3171 test_repo 22/.git/sub ..
3172 '
3173
3174 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=.(rel) in .git/sub' '
3174 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=.(rel) in .git/sub' '
3175 cat >22/.git/sub/expected <<EOF &&
3176 setup: git_dir: $TRASH_DIRECTORY/22/.git
3177 setup: worktree: $TRASH_DIRECTORY/22/.git
@@ -3292,7 +3292,7 @@ EOF
3292 test_repo 22/.git/sub "$TRASH_DIRECTORY/22/.git"
3293 '
3294
3295 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=.. at .git' '
3295 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=.. at .git' '
3296 cat >22/.git/expected <<EOF &&
3297 setup: git_dir: $TRASH_DIRECTORY/22/.git
3298 setup: worktree: $TRASH_DIRECTORY/22
@@ -3303,7 +3303,7 @@ EOF
3303 test_repo 22/.git .
3304 '
3305
3306 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=..(rel) at .git' '
3306 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=..(rel) at .git' '
3307 cat >22/.git/expected <<EOF &&
3308 setup: git_dir: $TRASH_DIRECTORY/22/.git
3309 setup: worktree: $TRASH_DIRECTORY/22
@@ -3336,7 +3336,7 @@ EOF
3336 test_repo 22/.git "$TRASH_DIRECTORY/22/.git"
3337 '
3338
3339 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=.. in .git/sub' '
3339 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=.. in .git/sub' '
3340 cat >22/.git/sub/expected <<EOF &&
3341 setup: git_dir: $TRASH_DIRECTORY/22/.git
3342 setup: worktree: $TRASH_DIRECTORY/22
@@ -3347,7 +3347,7 @@ EOF
3347 test_repo 22/.git/sub ..
3348 '
3349
3350 -test_expect_failure '#22.1: GIT_DIR(rel), core.worktree=..(rel) in .git/sub' '
3350 +test_expect_success '#22.1: GIT_DIR(rel), core.worktree=..(rel) in .git/sub' '
3351 cat >22/.git/sub/expected <<EOF &&
3352 setup: git_dir: $TRASH_DIRECTORY/22/.git
3353 setup: worktree: $TRASH_DIRECTORY/22
@@ -3401,7 +3401,7 @@ test_expect_success '#22.2: setup' '
3401 git config --file="$TRASH_DIRECTORY/22/.git/config" core.bare true
3402 '
3403
3404 -test_expect_failure '#22.2: at .git' '
3404 +test_expect_success '#22.2: at .git' '
3405 (
3406 cd 22/.git &&
3407 GIT_DIR=. &&
@@ -3411,7 +3411,7 @@ test_expect_failure '#22.2: at .git' '
3411 )
3412 '
3413
3414 -test_expect_failure '#22.2: at root' '
3414 +test_expect_success '#22.2: at root' '
3415 (
3416 cd 22 &&
3417 GIT_DIR=.git &&
@@ -3814,7 +3814,7 @@ test_expect_success '#26: setup' '
3814 cd ..
3815 '
3816
3817 -test_expect_failure '#26: (rel) at root' '
3817 +test_expect_success '#26: (rel) at root' '
3818 cat >26/expected <<EOF &&
3819 setup: git_dir: $TRASH_DIRECTORY/26.git
3820 setup: worktree: (null)
@@ -3824,7 +3824,7 @@ EOF
3824 test_repo 26 .git
3825 '
3826
3827 -test_expect_failure '#26: at root' '
3827 +test_expect_success '#26: at root' '
3828 cat >26/expected <<EOF &&
3829 setup: git_dir: $TRASH_DIRECTORY/26.git
3830 setup: worktree: (null)
@@ -3834,7 +3834,7 @@ EOF
3834 test_repo 26 "$TRASH_DIRECTORY/26/.git"
3835 '
3836
3837 -test_expect_failure '#26: (rel) in subdir' '
3837 +test_expect_success '#26: (rel) in subdir' '
3838 cat >26/sub/expected <<EOF &&
3839 setup: git_dir: $TRASH_DIRECTORY/26.git
3840 setup: worktree: (null)
@@ -3844,7 +3844,7 @@ EOF
3844 test_repo 26/sub ../.git
3845 '
3846
3847 -test_expect_failure '#26: in subdir' '
3847 +test_expect_success '#26: in subdir' '
3848 cat >26/sub/expected <<EOF &&
3849 setup: git_dir: $TRASH_DIRECTORY/26.git
3850 setup: worktree: (null)
@@ -3882,7 +3882,7 @@ test_expect_success '#27: setup' '
3882 cd ..
3883 '
3884
3885 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
3885 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
3886 cat >27/expected <<EOF &&
3887 setup: git_dir: $TRASH_DIRECTORY/27.git
3888 setup: worktree: $TRASH_DIRECTORY/27
@@ -3892,7 +3892,7 @@ EOF
3892 test_repo 27 .git "$TRASH_DIRECTORY/27"
3893 '
3894
3895 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
3895 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
3896 cat >27/expected <<EOF &&
3897 setup: git_dir: $TRASH_DIRECTORY/27.git
3898 setup: worktree: $TRASH_DIRECTORY/27
@@ -3902,7 +3902,7 @@ EOF
3902 test_repo 27 .git .
3903 '
3904
3905 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=root at root' '
3905 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=root at root' '
3906 cat >27/expected <<EOF &&
3907 setup: git_dir: $TRASH_DIRECTORY/27.git
3908 setup: worktree: $TRASH_DIRECTORY/27
@@ -3912,7 +3912,7 @@ EOF
3912 test_repo 27 "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY/27"
3913 '
3914
3915 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
3915 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
3916 cat >27/expected <<EOF &&
3917 setup: git_dir: $TRASH_DIRECTORY/27.git
3918 setup: worktree: $TRASH_DIRECTORY/27
@@ -3922,7 +3922,7 @@ EOF
3922 test_repo 27 "$TRASH_DIRECTORY/27/.git" .
3923 '
3924
3925 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
3925 +test_expect_success '#27: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
3926 cat >27/sub/sub/expected <<EOF &&
3927 setup: git_dir: $TRASH_DIRECTORY/27.git
3928 setup: worktree: $TRASH_DIRECTORY/27
@@ -3932,7 +3932,7 @@ EOF
3932 test_repo 27/sub/sub ../../.git "$TRASH_DIRECTORY/27"
3933 '
3934
3935 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
3935 +test_expect_success '#27: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
3936 cat >27/sub/sub/expected <<EOF &&
3937 setup: git_dir: $TRASH_DIRECTORY/27.git
3938 setup: worktree: $TRASH_DIRECTORY/27
@@ -3942,7 +3942,7 @@ EOF
3942 test_repo 27/sub/sub ../../.git ../..
3943 '
3944
3945 -test_expect_failure '#27: GIT_DIR, GIT_WORKTREE=root in subdir' '
3945 +test_expect_success '#27: GIT_DIR, GIT_WORKTREE=root in subdir' '
3946 cat >27/sub/expected <<EOF &&
3947 setup: git_dir: $TRASH_DIRECTORY/27.git
3948 setup: worktree: $TRASH_DIRECTORY/27
@@ -3952,7 +3952,7 @@ EOF
3952 test_repo 27/sub "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY/27"
3953 '
3954
3955 -test_expect_failure '#27: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
3955 +test_expect_success '#27: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
3956 cat >27/sub/sub/expected <<EOF &&
3957 setup: git_dir: $TRASH_DIRECTORY/27.git
3958 setup: worktree: $TRASH_DIRECTORY/27
@@ -3962,7 +3962,7 @@ EOF
3962 test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" ../..
3963 '
3964
3965 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
3965 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
3966 cat >27/expected <<EOF &&
3967 setup: git_dir: $TRASH_DIRECTORY/27.git
3968 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -3972,7 +3972,7 @@ EOF
3972 test_repo 27 .git "$TRASH_DIRECTORY/27/wt"
3973 '
3974
3975 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
3975 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
3976 cat >27/expected <<EOF &&
3977 setup: git_dir: $TRASH_DIRECTORY/27.git
3978 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -3982,7 +3982,7 @@ EOF
3982 test_repo 27 .git wt
3983 '
3984
3985 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
3985 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
3986 cat >27/expected <<EOF &&
3987 setup: git_dir: $TRASH_DIRECTORY/27.git
3988 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -3992,7 +3992,7 @@ EOF
3992 test_repo 27 "$TRASH_DIRECTORY/27/.git" wt
3993 '
3994
3995 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=wt at root' '
3995 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=wt at root' '
3996 cat >27/expected <<EOF &&
3997 setup: git_dir: $TRASH_DIRECTORY/27.git
3998 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -4002,7 +4002,7 @@ EOF
4002 test_repo 27 "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY/27/wt"
4003 '
4004
4005 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
4005 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
4006 cat >27/sub/sub/expected <<EOF &&
4007 setup: git_dir: $TRASH_DIRECTORY/27.git
4008 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -4012,7 +4012,7 @@ EOF
4012 test_repo 27/sub/sub ../../.git "$TRASH_DIRECTORY/27/wt"
4013 '
4014
4015 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
4015 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
4016 cat >27/sub/sub/expected <<EOF &&
4017 setup: git_dir: $TRASH_DIRECTORY/27.git
4018 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -4022,7 +4022,7 @@ EOF
4022 test_repo 27/sub/sub ../../.git ../../wt
4023 '
4024
4025 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
4025 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
4026 cat >27/sub/sub/expected <<EOF &&
4027 setup: git_dir: $TRASH_DIRECTORY/27.git
4028 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -4032,7 +4032,7 @@ EOF
4032 test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" ../../wt
4033 '
4034
4035 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
4035 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
4036 cat >27/sub/sub/expected <<EOF &&
4037 setup: git_dir: $TRASH_DIRECTORY/27.git
4038 setup: worktree: $TRASH_DIRECTORY/27/wt
@@ -4042,7 +4042,7 @@ EOF
4042 test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY/27/wt"
4043 '
4044
4045 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
4045 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
4046 cat >27/expected <<EOF &&
4047 setup: git_dir: $TRASH_DIRECTORY/27.git
4048 setup: worktree: $TRASH_DIRECTORY
@@ -4052,7 +4052,7 @@ EOF
4052 test_repo 27 .git "$TRASH_DIRECTORY"
4053 '
4054
4055 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
4055 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
4056 cat >27/expected <<EOF &&
4057 setup: git_dir: $TRASH_DIRECTORY/27.git
4058 setup: worktree: $TRASH_DIRECTORY
@@ -4062,7 +4062,7 @@ EOF
4062 test_repo 27 .git ..
4063 '
4064
4065 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
4065 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
4066 cat >27/expected <<EOF &&
4067 setup: git_dir: $TRASH_DIRECTORY/27.git
4068 setup: worktree: $TRASH_DIRECTORY
@@ -4072,7 +4072,7 @@ EOF
4072 test_repo 27 "$TRASH_DIRECTORY/27/.git" ..
4073 '
4074
4075 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=.. at root' '
4075 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=.. at root' '
4076 cat >27/expected <<EOF &&
4077 setup: git_dir: $TRASH_DIRECTORY/27.git
4078 setup: worktree: $TRASH_DIRECTORY
@@ -4082,7 +4082,7 @@ EOF
4082 test_repo 27 "$TRASH_DIRECTORY/27/.git" "$TRASH_DIRECTORY"
4083 '
4084
4085 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
4085 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
4086 cat >27/sub/sub/expected <<EOF &&
4087 setup: git_dir: $TRASH_DIRECTORY/27.git
4088 setup: worktree: $TRASH_DIRECTORY
@@ -4092,7 +4092,7 @@ EOF
4092 test_repo 27/sub/sub ../../.git "$TRASH_DIRECTORY"
4093 '
4094
4095 -test_expect_failure '#27: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
4095 +test_expect_success '#27: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
4096 cat >27/sub/sub/expected <<EOF &&
4097 setup: git_dir: $TRASH_DIRECTORY/27.git
4098 setup: worktree: $TRASH_DIRECTORY
@@ -4102,7 +4102,7 @@ EOF
4102 test_repo 27/sub/sub ../../.git ../../..
4103 '
4104
4105 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
4105 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
4106 cat >27/sub/sub/expected <<EOF &&
4107 setup: git_dir: $TRASH_DIRECTORY/27.git
4108 setup: worktree: $TRASH_DIRECTORY
@@ -4112,7 +4112,7 @@ EOF
4112 test_repo 27/sub/sub "$TRASH_DIRECTORY/27/.git" ../../../
4113 '
4114
4115 -test_expect_failure '#27: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
4115 +test_expect_success '#27: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
4116 cat >27/sub/sub/expected <<EOF &&
4117 setup: git_dir: $TRASH_DIRECTORY/27.git
4118 setup: worktree: $TRASH_DIRECTORY
@@ -4250,7 +4250,7 @@ test_expect_success '#30: setup' '
4250 cd ..
4251 '
4252
4253 -test_expect_failure '#30: at root' '
4253 +test_expect_success '#30: at root' '
4254 (
4255 cd 30 &&
4256 GIT_DIR=.git &&
@@ -4289,7 +4289,7 @@ test_expect_success '#31: setup' '
4289 cd ..
4290 '
4291
4292 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
4292 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=root at root' '
4293 cat >31/expected <<EOF &&
4294 setup: git_dir: $TRASH_DIRECTORY/31.git
4295 setup: worktree: $TRASH_DIRECTORY/31
@@ -4299,7 +4299,7 @@ EOF
4299 test_repo 31 .git "$TRASH_DIRECTORY/31"
4300 '
4301
4302 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
4302 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=root(rel) at root' '
4303 cat >31/expected <<EOF &&
4304 setup: git_dir: $TRASH_DIRECTORY/31.git
4305 setup: worktree: $TRASH_DIRECTORY/31
@@ -4309,7 +4309,7 @@ EOF
4309 test_repo 31 .git .
4310 '
4311
4312 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=root at root' '
4312 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=root at root' '
4313 cat >31/expected <<EOF &&
4314 setup: git_dir: $TRASH_DIRECTORY/31.git
4315 setup: worktree: $TRASH_DIRECTORY/31
@@ -4319,7 +4319,7 @@ EOF
4319 test_repo 31 "$TRASH_DIRECTORY/31/.git" "$TRASH_DIRECTORY/31"
4320 '
4321
4322 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
4322 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=root(rel) at root' '
4323 cat >31/expected <<EOF &&
4324 setup: git_dir: $TRASH_DIRECTORY/31.git
4325 setup: worktree: $TRASH_DIRECTORY/31
@@ -4329,7 +4329,7 @@ EOF
4329 test_repo 31 "$TRASH_DIRECTORY/31/.git" .
4330 '
4331
4332 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
4332 +test_expect_success '#31: GIT_DIR(rel), GIT_WORKTREE=root in subdir' '
4333 cat >31/sub/sub/expected <<EOF &&
4334 setup: git_dir: $TRASH_DIRECTORY/31.git
4335 setup: worktree: $TRASH_DIRECTORY/31
@@ -4339,7 +4339,7 @@ EOF
4339 test_repo 31/sub/sub ../../.git "$TRASH_DIRECTORY/31"
4340 '
4341
4342 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
4342 +test_expect_success '#31: GIT_DIR(rel), GIT_WORKTREE=root(rel) in subdir' '
4343 cat >31/sub/sub/expected <<EOF &&
4344 setup: git_dir: $TRASH_DIRECTORY/31.git
4345 setup: worktree: $TRASH_DIRECTORY/31
@@ -4349,7 +4349,7 @@ EOF
4349 test_repo 31/sub/sub ../../.git ../..
4350 '
4351
4352 -test_expect_failure '#31: GIT_DIR, GIT_WORKTREE=root in subdir' '
4352 +test_expect_success '#31: GIT_DIR, GIT_WORKTREE=root in subdir' '
4353 cat >31/sub/expected <<EOF &&
4354 setup: git_dir: $TRASH_DIRECTORY/31.git
4355 setup: worktree: $TRASH_DIRECTORY/31
@@ -4359,7 +4359,7 @@ EOF
4359 test_repo 31/sub "$TRASH_DIRECTORY/31/.git" "$TRASH_DIRECTORY/31"
4360 '
4361
4362 -test_expect_failure '#31: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
4362 +test_expect_success '#31: GIT_DIR, GIT_WORKTREE=root(rel) in subdir' '
4363 cat >31/sub/sub/expected <<EOF &&
4364 setup: git_dir: $TRASH_DIRECTORY/31.git
4365 setup: worktree: $TRASH_DIRECTORY/31
@@ -4369,7 +4369,7 @@ EOF
4369 test_repo 31/sub/sub "$TRASH_DIRECTORY/31/.git" ../..
4370 '
4371
4372 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
4372 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=wt at root' '
4373 cat >31/expected <<EOF &&
4374 setup: git_dir: $TRASH_DIRECTORY/31.git
4375 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4379,7 +4379,7 @@ EOF
4379 test_repo 31 .git "$TRASH_DIRECTORY/31/wt"
4380 '
4381
4382 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
4382 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) at root' '
4383 cat >31/expected <<EOF &&
4384 setup: git_dir: $TRASH_DIRECTORY/31.git
4385 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4389,7 +4389,7 @@ EOF
4389 test_repo 31 .git wt
4390 '
4391
4392 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
4392 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=wt(rel) at root' '
4393 cat >31/expected <<EOF &&
4394 setup: git_dir: $TRASH_DIRECTORY/31.git
4395 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4399,7 +4399,7 @@ EOF
4399 test_repo 31 "$TRASH_DIRECTORY/31/.git" wt
4400 '
4401
4402 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=wt at root' '
4402 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=wt at root' '
4403 cat >31/expected <<EOF &&
4404 setup: git_dir: $TRASH_DIRECTORY/31.git
4405 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4409,7 +4409,7 @@ EOF
4409 test_repo 31 "$TRASH_DIRECTORY/31/.git" "$TRASH_DIRECTORY/31/wt"
4410 '
4411
4412 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
4412 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=wt in subdir' '
4413 cat >31/sub/sub/expected <<EOF &&
4414 setup: git_dir: $TRASH_DIRECTORY/31.git
4415 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4419,7 +4419,7 @@ EOF
4419 test_repo 31/sub/sub ../../.git "$TRASH_DIRECTORY/31/wt"
4420 '
4421
4422 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
4422 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=wt(rel) in subdir' '
4423 cat >31/sub/sub/expected <<EOF &&
4424 setup: git_dir: $TRASH_DIRECTORY/31.git
4425 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4429,7 +4429,7 @@ EOF
4429 test_repo 31/sub/sub ../../.git ../../wt
4430 '
4431
4432 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
4432 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=wt(rel) in subdir' '
4433 cat >31/sub/sub/expected <<EOF &&
4434 setup: git_dir: $TRASH_DIRECTORY/31.git
4435 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4439,7 +4439,7 @@ EOF
4439 test_repo 31/sub/sub "$TRASH_DIRECTORY/31/.git" ../../wt
4440 '
4441
4442 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
4442 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=wt in subdir' '
4443 cat >31/sub/sub/expected <<EOF &&
4444 setup: git_dir: $TRASH_DIRECTORY/31.git
4445 setup: worktree: $TRASH_DIRECTORY/31/wt
@@ -4449,7 +4449,7 @@ EOF
4449 test_repo 31/sub/sub "$TRASH_DIRECTORY/31/.git" "$TRASH_DIRECTORY/31/wt"
4450 '
4451
4452 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
4452 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=.. at root' '
4453 cat >31/expected <<EOF &&
4454 setup: git_dir: $TRASH_DIRECTORY/31.git
4455 setup: worktree: $TRASH_DIRECTORY
@@ -4459,7 +4459,7 @@ EOF
4459 test_repo 31 .git "$TRASH_DIRECTORY"
4460 '
4461
4462 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
4462 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=..(rel) at root' '
4463 cat >31/expected <<EOF &&
4464 setup: git_dir: $TRASH_DIRECTORY/31.git
4465 setup: worktree: $TRASH_DIRECTORY
@@ -4469,7 +4469,7 @@ EOF
4469 test_repo 31 .git ..
4470 '
4471
4472 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
4472 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=..(rel) at root' '
4473 cat >31/expected <<EOF &&
4474 setup: git_dir: $TRASH_DIRECTORY/31.git
4475 setup: worktree: $TRASH_DIRECTORY
@@ -4479,7 +4479,7 @@ EOF
4479 test_repo 31 "$TRASH_DIRECTORY/31/.git" ..
4480 '
4481
4482 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=.. at root' '
4482 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=.. at root' '
4483 cat >31/expected <<EOF &&
4484 setup: git_dir: $TRASH_DIRECTORY/31.git
4485 setup: worktree: $TRASH_DIRECTORY
@@ -4489,7 +4489,7 @@ EOF
4489 test_repo 31 "$TRASH_DIRECTORY/31/.git" "$TRASH_DIRECTORY"
4490 '
4491
4492 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
4492 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=.. in subdir' '
4493 cat >31/sub/sub/expected <<EOF &&
4494 setup: git_dir: $TRASH_DIRECTORY/31.git
4495 setup: worktree: $TRASH_DIRECTORY
@@ -4499,7 +4499,7 @@ EOF
4499 test_repo 31/sub/sub ../../.git "$TRASH_DIRECTORY"
4500 '
4501
4502 -test_expect_failure '#31: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
4502 +test_expect_success '#31: GIT_DIR(rel), GIT_WORK_TREE=..(rel) in subdir' '
4503 cat >31/sub/sub/expected <<EOF &&
4504 setup: git_dir: $TRASH_DIRECTORY/31.git
4505 setup: worktree: $TRASH_DIRECTORY
@@ -4509,7 +4509,7 @@ EOF
4509 test_repo 31/sub/sub ../../.git ../../..
4510 '
4511
4512 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
4512 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=..(rel) in subdir' '
4513 cat >31/sub/sub/expected <<EOF &&
4514 setup: git_dir: $TRASH_DIRECTORY/31.git
4515 setup: worktree: $TRASH_DIRECTORY
@@ -4519,7 +4519,7 @@ EOF
4519 test_repo 31/sub/sub "$TRASH_DIRECTORY/31/.git" ../../../
4520 '
4521
4522 -test_expect_failure '#31: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
4522 +test_expect_success '#31: GIT_DIR, GIT_WORK_TREE=.. in subdir' '
4523 cat >31/sub/sub/expected <<EOF &&
4524 setup: git_dir: $TRASH_DIRECTORY/31.git
4525 setup: worktree: $TRASH_DIRECTORY