@@ -75,13 +75,13 @@ test_expect_success 'git branch HEAD should fail' '
75
75
test_must_fail git branch HEAD
76
76
'
77
77
78
- cat > expect << EOF
79
- $HEAD refs/heads/d/e/f@{0}: branch: Created from main
80
- EOF
81
78
test_expect_success ' git branch --create-reflog d/e/f should create a branch and a log' '
82
79
GIT_COMMITTER_DATE="2005-05-26 23:30" \
83
80
git -c core.logallrefupdates=false branch --create-reflog d/e/f &&
84
81
test_ref_exists refs/heads/d/e/f &&
82
+ cat >expect <<-EOF &&
83
+ $HEAD refs/heads/d/e/f@{0}: branch: Created from main
84
+ EOF
85
85
git reflog show --no-abbrev-commit refs/heads/d/e/f >actual &&
86
86
test_cmp expect actual
87
87
'
@@ -440,10 +440,10 @@ test_expect_success 'git branch --list -v with --abbrev' '
440
440
441
441
test_expect_success ' git branch --column' '
442
442
COLUMNS=81 git branch --column=column >actual &&
443
- cat >expect <<\EOF &&
444
- a/b/c bam foo l * main n o/p r
445
- abc bar j/k m/m mb o/o q topic
446
- EOF
443
+ cat >expect <<- \EOF &&
444
+ a/b/c bam foo l * main n o/p r
445
+ abc bar j/k m/m mb o/o q topic
446
+ EOF
447
447
test_cmp expect actual
448
448
'
449
449
@@ -453,25 +453,25 @@ test_expect_success 'git branch --column with an extremely long branch name' '
453
453
test_when_finished "git branch -d $long" &&
454
454
git branch $long &&
455
455
COLUMNS=80 git branch --column=column >actual &&
456
- cat >expect <<EOF &&
457
- a/b/c
458
- abc
459
- bam
460
- bar
461
- foo
462
- j/k
463
- l
464
- m/m
465
- * main
466
- mb
467
- n
468
- o/o
469
- o/p
470
- q
471
- r
472
- topic
473
- $long
474
- EOF
456
+ cat >expect <<- EOF &&
457
+ a/b/c
458
+ abc
459
+ bam
460
+ bar
461
+ foo
462
+ j/k
463
+ l
464
+ m/m
465
+ * main
466
+ mb
467
+ n
468
+ o/o
469
+ o/p
470
+ q
471
+ r
472
+ topic
473
+ $long
474
+ EOF
475
475
test_cmp expect actual
476
476
'
477
477
@@ -481,10 +481,10 @@ test_expect_success 'git branch with column.*' '
481
481
COLUMNS=80 git branch >actual &&
482
482
git config --unset column.branch &&
483
483
git config --unset column.ui &&
484
- cat >expect <<\EOF &&
485
- a/b/c bam foo l * main n o/p r
486
- abc bar j/k m/m mb o/o q topic
487
- EOF
484
+ cat >expect <<- \EOF &&
485
+ a/b/c bam foo l * main n o/p r
486
+ abc bar j/k m/m mb o/o q topic
487
+ EOF
488
488
test_cmp expect actual
489
489
'
490
490
@@ -496,39 +496,36 @@ test_expect_success 'git branch -v with column.ui ignored' '
496
496
git config column.ui column &&
497
497
COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual &&
498
498
git config --unset column.ui &&
499
- cat >expect <<\EOF &&
500
- a/b/c
501
- abc
502
- bam
503
- bar
504
- foo
505
- j/k
506
- l
507
- m/m
508
- * main
509
- mb
510
- n
511
- o/o
512
- o/p
513
- q
514
- r
515
- topic
516
- EOF
499
+ cat >expect <<- \EOF &&
500
+ a/b/c
501
+ abc
502
+ bam
503
+ bar
504
+ foo
505
+ j/k
506
+ l
507
+ m/m
508
+ * main
509
+ mb
510
+ n
511
+ o/o
512
+ o/p
513
+ q
514
+ r
515
+ topic
516
+ EOF
517
517
test_cmp expect actual
518
518
'
519
519
520
- mv .git/config .git/config-saved
521
-
522
520
test_expect_success DEFAULT_REPO_FORMAT ' git branch -m q q2 without config should succeed' '
521
+ test_when_finished mv .git/config-saved .git/config &&
522
+ mv .git/config .git/config-saved &&
523
523
git branch -m q q2 &&
524
524
git branch -m q2 q
525
525
'
526
526
527
- mv .git/config-saved .git/config
528
-
529
- git config branch.s/s.dummy Hello
530
-
531
527
test_expect_success ' git branch -m s/s s should work when s/t is deleted' '
528
+ git config branch.s/s.dummy Hello &&
532
529
git branch --create-reflog s/s &&
533
530
git reflog exists refs/heads/s/s &&
534
531
git branch --create-reflog s/t &&
@@ -1141,14 +1138,14 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups
1141
1138
test_cmp expect actual
1142
1139
"
1143
1140
1144
- # Keep this test last, as it changes the current branch
1145
- cat > expect << EOF
1146
- $HEAD refs/heads/g/h/i@{0}: branch: Created from main
1147
- EOF
1148
1141
test_expect_success ' git checkout -b g/h/i -l should create a branch and a log' '
1142
+ test_when_finished git checkout main &&
1149
1143
GIT_COMMITTER_DATE="2005-05-26 23:30" \
1150
1144
git checkout -b g/h/i -l main &&
1151
1145
test_ref_exists refs/heads/g/h/i &&
1146
+ cat >expect <<-EOF &&
1147
+ $HEAD refs/heads/g/h/i@{0}: branch: Created from main
1148
+ EOF
1152
1149
git reflog show --no-abbrev-commit refs/heads/g/h/i >actual &&
1153
1150
test_cmp expect actual
1154
1151
'
0 commit comments