@matheusbsbs / matheus-bagliano / commits / 432f5e638d
Fork 0

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 <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Johannes Schindelin committed Sep 21, 2020 at 22:01 UTC 432f5e638d00fc9175594c73c1a9e81af1928872
1 file changed +17 -17
t/t3200-branch.sh
+17 -17
@@ -234,10 +234,10 @@ test_expect_success 'git branch -M master master should work when master is chec
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,8 +324,8 @@ test_expect_success 'git branch --list -v with --abbrev' '
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,13 +346,13 @@ test_expect_success 'git branch --column with an extremely long branch name' '
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,8 +365,8 @@ test_expect_success 'git branch with column.*' '
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,7 +377,7 @@ test_expect_success 'git branch --column -v should fail' '
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,13 +389,13 @@ test_expect_success 'git branch -v with column.ui ignored' '
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,10 +597,10 @@ test_expect_success 'git branch -C master master should work when master is chec
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,11 +711,11 @@ test_expect_success 'deleting a self-referential symref' '
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' '