Skip to content

Commit 432f5e6

Browse files
dschogitster
authored andcommitted
t3200: avoid variations of the master branch name
To avoid branch names with a loaded history, we already started to avoid using the name "master" in a couple instances. The `t3200-branch.sh` script uses variations of this name for branches other than the default one. So let's change those names, as "lowest-hanging fruits" in the effort to use more inclusive naming throughout Git's source code. While at it, make those branch names independent from the default branch name. In this particular instance, this rename requires a couple of non-trivial adjustments, as the aligned output depends on the maximum length of the displayed branches (which we now changed), and also on the alphabetical order (which we now changed, too). Signed-off-by: Johannes Schindelin <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 5a0c32b commit 432f5e6

File tree

1 file changed

+17
-17
lines changed

1 file changed

+17
-17
lines changed

t/t3200-branch.sh

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -234,10 +234,10 @@ test_expect_success 'git branch -M master master should work when master is chec
234234
git branch -M master master
235235
'
236236

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' '
238238
git checkout master &&
239-
git branch master2 &&
240-
git branch -M master2 master2
239+
git branch topic &&
240+
git branch -M topic topic
241241
'
242242

243243
test_expect_success 'git branch -v -d t should work' '
@@ -324,8 +324,8 @@ test_expect_success 'git branch --list -v with --abbrev' '
324324
test_expect_success 'git branch --column' '
325325
COLUMNS=81 git branch --column=column >actual &&
326326
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
329329
EOF
330330
test_cmp expect actual
331331
'
@@ -346,13 +346,13 @@ test_expect_success 'git branch --column with an extremely long branch name' '
346346
l
347347
m/m
348348
* master
349-
master2
350349
mb
351350
n
352351
o/o
353352
o/p
354353
q
355354
r
355+
topic
356356
$long
357357
EOF
358358
test_cmp expect actual
@@ -365,8 +365,8 @@ test_expect_success 'git branch with column.*' '
365365
git config --unset column.branch &&
366366
git config --unset column.ui &&
367367
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
370370
EOF
371371
test_cmp expect actual
372372
'
@@ -377,7 +377,7 @@ test_expect_success 'git branch --column -v should fail' '
377377

378378
test_expect_success 'git branch -v with column.ui ignored' '
379379
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 &&
381381
git config --unset column.ui &&
382382
cat >expect <<\EOF &&
383383
a/b/c
@@ -389,13 +389,13 @@ test_expect_success 'git branch -v with column.ui ignored' '
389389
l
390390
m/m
391391
* master
392-
master2
393392
mb
394393
n
395394
o/o
396395
o/p
397396
q
398397
r
398+
topic
399399
EOF
400400
test_cmp expect actual
401401
'
@@ -597,10 +597,10 @@ test_expect_success 'git branch -C master master should work when master is chec
597597
git branch -C master master
598598
'
599599

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' '
601601
git checkout master &&
602-
git branch master5 &&
603-
git branch -C master5 master5
602+
git branch main5 &&
603+
git branch -C main5 main5
604604
'
605605

606606
test_expect_success 'git branch -C ab cd should overwrite existing config for cd' '
@@ -711,11 +711,11 @@ test_expect_success 'deleting a self-referential symref' '
711711
'
712712

713713
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 &&
717717
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
719719
'
720720

721721
test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for u is a symlink' '

0 commit comments

Comments
 (0)