234
git branch -M master master
235
'
236
237
-test_expect_success 'git branch -M master2 master2 should work when master is checked out' '
237
+test_expect_success 'git branch -M topic topic should work when master is checked out' '
238
git checkout master &&
239
- git branch master2 &&
240
- git branch -M master2 master2
239
+ git branch topic &&
240
+ git branch -M topic topic
241
'
242
243
test_expect_success 'git branch -v -d t should work' '
324
test_expect_success 'git branch --column' '
325
COLUMNS=81 git branch --column=column >actual &&
326
cat >expect <<\EOF &&
327
- a/b/c bam foo l * master mb o/o q
328
- abc bar j/k m/m master2 n o/p r
327
+ a/b/c bam foo l * master n o/p r
328
+ abc bar j/k m/m mb o/o q topic
329
EOF
330
test_cmp expect actual
331
'
346
l
347
m/m
348
* master
349
- master2
349
mb
350
n
351
o/o
352
o/p
353
q
354
r
355
+ topic
356
$long
357
EOF
358
test_cmp expect actual
365
git config --unset column.branch &&
366
git config --unset column.ui &&
367
cat >expect <<\EOF &&
368
- a/b/c bam foo l * master mb o/o q
369
- abc bar j/k m/m master2 n o/p r
368
+ a/b/c bam foo l * master n o/p r
369
+ abc bar j/k m/m mb o/o q topic
370
EOF
371
test_cmp expect actual
372
'
377
378
test_expect_success 'git branch -v with column.ui ignored' '
379
git config column.ui column &&
380
- COLUMNS=80 git branch -v | cut -c -10 | sed "s/ *$//" >actual &&
380
+ COLUMNS=80 git branch -v | cut -c -9 | sed "s/ *$//" >actual &&
381
git config --unset column.ui &&
382
cat >expect <<\EOF &&
383
a/b/c
389
l
390
m/m
391
* master
392
- master2
392
mb
393
n
394
o/o
395
o/p
396
q
397
r
398
+ topic
399
EOF
400
test_cmp expect actual
401
'
597
git branch -C master master
598
'
599
600
-test_expect_success 'git branch -C master5 master5 should work when master is checked out' '
600
+test_expect_success 'git branch -C main5 main5 should work when master is checked out' '
601
git checkout master &&
602
- git branch master5 &&
603
- git branch -C master5 master5
602
+ git branch main5 &&
603
+ git branch -C main5 main5
604
'
605
606
test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '
711
'
712
713
test_expect_success 'renaming a symref is not allowed' '
714
- git symbolic-ref refs/heads/master2 refs/heads/master &&
715
- test_must_fail git branch -m master2 master3 &&
716
- git symbolic-ref refs/heads/master2 &&
714
+ git symbolic-ref refs/heads/topic refs/heads/master &&
715
+ test_must_fail git branch -m topic new-topic &&
716
+ git symbolic-ref refs/heads/topic &&
717
test_path_is_file .git/refs/heads/master &&
718
- test_path_is_missing .git/refs/heads/master3
718
+ test_path_is_missing .git/refs/heads/new-topic
719
'
720
721
test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '