From patchwork Thu Dec 17 01:07:00 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978845 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D9C28C4361B for ; Thu, 17 Dec 2020 01:08:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A2F7422CB3 for ; Thu, 17 Dec 2020 01:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731287AbgLQBHz (ORCPT ); Wed, 16 Dec 2020 20:07:55 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731284AbgLQBHy (ORCPT ); Wed, 16 Dec 2020 20:07:54 -0500 Received: from mail-wm1-x336.google.com (mail-wm1-x336.google.com [IPv6:2a00:1450:4864:20::336]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6DDE0C0617A6 for ; Wed, 16 Dec 2020 17:07:14 -0800 (PST) Received: by mail-wm1-x336.google.com with SMTP id x22so4006935wmc.5 for ; Wed, 16 Dec 2020 17:07:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Fc317wPVuCV3lwh5JeHKTpiAnuns0cCAPb8JoDxm3Us=; b=oNPApUkgqqGitIZp+77Jq7LQekkpv5jODpaLQ8OrDEoe2qFzzvfaQPz/ndcdluQsmQ EYAXyr9JjnqwB332XGr8p4v4bNFEPCqezirygitfunr4xpKhu1EpCWveuWyyJJ7QCiDA l0eBJKq3CAs04i6rvqmfdOZoeWsX7/CNXuU4fiaJ0M5+tR3QZKRbcVWzVnPyTgyJ9SDb FFLxL/uzkzLLqJo4nN2Pje+s3Wy4yKg1o3nPmCijQhRJky9oNoK/JGC4kc5yjKIgWPlE dp5CX4+Poz9l9Q6N5DsW4rPNuJhrmb/M1vLaj0VCWDEO3kcdpL+cfTzCdsftnigDxxwQ ayVw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Fc317wPVuCV3lwh5JeHKTpiAnuns0cCAPb8JoDxm3Us=; b=eAqjneVSDz6UjUWUEH3PYCUAAduG0KGNFigMbEO9vCO0M4CzbJt3LgIufE9LVO0uyd z8sZe1pGt/0kkyYNtakLwar4HB3PowaXrM6smYaVEWn1ZRWR6SGIfbWskkXMQvqjwJ3a wzb0yBe6YfQowgsJvS8IiaIa93XMbkIdP49Izz8/2wXTgcYXJaX4jzCC2APdSb8mOwSD A150eKDSNS+tP+Z7hsQ0vA5sQgm1LZqzmN6DnyxxiP+0UjoSykGiY5E1EGOE+oZKrEGm wUs36pfTcAAy1YtMRSnhiW+8cftJ9bf9PrcjphylspXkCstWGeDToAFXkXNB/YKnB11R Gmjw== X-Gm-Message-State: AOAM532XAImEAlggq9vPcjlUYtGlzBUbArtTnRqvWymWYd6XsisupPS3 lDxTYlcvQs+88NomrbQ3ZHsUjEeRF9k= X-Google-Smtp-Source: ABdhPJx0HhGO2dQLjO/96SBZaiQbshLQZ555owobMIcSIlMFFGO+7PWckma7XgA9t39YwDOaSOydVQ== X-Received: by 2002:a7b:ce14:: with SMTP id m20mr5892374wmc.149.1608167232815; Wed, 16 Dec 2020 17:07:12 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y13sm488399wrl.63.2020.12.16.17.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:12 -0800 (PST) Message-Id: <802e8f2cfd2cec86d54202a844665c222f868605.1608167230.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:00 +0000 Subject: [PATCH 01/11] t1400: use `main` as initial branch name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 3224b0f0bb7 (t1400: prepare for `main` being default branch name, 2020-10-23), we prepared t1400 for a time when the default initial branch name would be `main`. However, there is no need to wait that long: let's adjust the test script to stop relying on a specific initial branch name by setting it explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from two test cases. Signed-off-by: Johannes Schindelin --- t/t1400-update-ref.sh | 75 ++++++++++++++++++++++--------------------- 1 file changed, 38 insertions(+), 37 deletions(-) diff --git a/t/t1400-update-ref.sh b/t/t1400-update-ref.sh index 31b64be521d..6ee7d216fb8 100755 --- a/t/t1400-update-ref.sh +++ b/t/t1400-update-ref.sh @@ -8,7 +8,7 @@ test_description='Test git update-ref and basic ref logging' Z=$ZERO_OID -m=refs/heads/master +m=refs/heads/main n_dir=refs/heads/gu n=$n_dir/fixes outside=refs/foo @@ -27,10 +27,11 @@ create_test_commits () } test_expect_success setup ' + git checkout --orphan main && create_test_commits "" && mkdir $bare && cd $bare && - git init --bare && + git init --bare -b main && create_test_commits "bare" && cd - ' @@ -264,7 +265,7 @@ test_expect_success "(not) changed .git/$m" ' ! test $B = $(git show-ref -s --verify $m) ' -rm -f .git/logs/refs/heads/master +rm -f .git/logs/refs/heads/main test_expect_success "create $m (logged by touch)" ' test_config core.logAllRefUpdates false && GIT_COMMITTER_DATE="2005-05-26 23:30" \ @@ -300,7 +301,7 @@ test_expect_success 'symref empty directory removal' ' git branch e1/e2/r1 HEAD && git branch e1/r2 HEAD && git checkout e1/e2/r1 && - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && test_path_is_file .git/refs/heads/e1/e2/r1 && test_path_is_file .git/logs/refs/heads/e1/e2/r1 && git update-ref -d HEAD && @@ -364,68 +365,68 @@ test_expect_success 'set up for querying the reflog' ' ed="Thu, 26 May 2005 18:32:00 -0500" gd="Thu, 26 May 2005 18:33:00 -0500" ld="Thu, 26 May 2005 18:43:00 -0500" -test_expect_success 'Query "master@{May 25 2005}" (before history)' ' +test_expect_success 'Query "main@{May 25 2005}" (before history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{May 25 2005}" >o 2>e && + git rev-parse --verify "main@{May 25 2005}" >o 2>e && echo "$C" >expect && test_cmp expect o && - echo "warning: log for '\''master'\'' only goes back to $ed" >expect && + echo "warning: log for '\''main'\'' only goes back to $ed" >expect && test_i18ncmp expect e ' -test_expect_success 'Query master@{2005-05-25} (before history)' ' +test_expect_success 'Query main@{2005-05-25} (before history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify master@{2005-05-25} >o 2>e && + git rev-parse --verify main@{2005-05-25} >o 2>e && echo "$C" >expect && test_cmp expect o && - echo "warning: log for '\''master'\'' only goes back to $ed" >expect && + echo "warning: log for '\''main'\'' only goes back to $ed" >expect && test_i18ncmp expect e ' -test_expect_success 'Query "master@{May 26 2005 23:31:59}" (1 second before history)' ' +test_expect_success 'Query "main@{May 26 2005 23:31:59}" (1 second before history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{May 26 2005 23:31:59}" >o 2>e && + git rev-parse --verify "main@{May 26 2005 23:31:59}" >o 2>e && echo "$C" >expect && test_cmp expect o && - echo "warning: log for '\''master'\'' only goes back to $ed" >expect && + echo "warning: log for '\''main'\'' only goes back to $ed" >expect && test_i18ncmp expect e ' -test_expect_success 'Query "master@{May 26 2005 23:32:00}" (exactly history start)' ' +test_expect_success 'Query "main@{May 26 2005 23:32:00}" (exactly history start)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{May 26 2005 23:32:00}" >o 2>e && + git rev-parse --verify "main@{May 26 2005 23:32:00}" >o 2>e && echo "$C" >expect && test_cmp expect o && test_must_be_empty e ' -test_expect_success 'Query "master@{May 26 2005 23:32:30}" (first non-creation change)' ' +test_expect_success 'Query "main@{May 26 2005 23:32:30}" (first non-creation change)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{May 26 2005 23:32:30}" >o 2>e && + git rev-parse --verify "main@{May 26 2005 23:32:30}" >o 2>e && echo "$A" >expect && test_cmp expect o && test_must_be_empty e ' -test_expect_success 'Query "master@{2005-05-26 23:33:01}" (middle of history with gap)' ' +test_expect_success 'Query "main@{2005-05-26 23:33:01}" (middle of history with gap)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{2005-05-26 23:33:01}" >o 2>e && + git rev-parse --verify "main@{2005-05-26 23:33:01}" >o 2>e && echo "$B" >expect && test_cmp expect o && test_i18ngrep -F "warning: log for ref $m has gap after $gd" e ' -test_expect_success 'Query "master@{2005-05-26 23:38:00}" (middle of history)' ' +test_expect_success 'Query "main@{2005-05-26 23:38:00}" (middle of history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{2005-05-26 23:38:00}" >o 2>e && + git rev-parse --verify "main@{2005-05-26 23:38:00}" >o 2>e && echo "$Z" >expect && test_cmp expect o && test_must_be_empty e ' -test_expect_success 'Query "master@{2005-05-26 23:43:00}" (exact end of history)' ' +test_expect_success 'Query "main@{2005-05-26 23:43:00}" (exact end of history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{2005-05-26 23:43:00}" >o 2>e && + git rev-parse --verify "main@{2005-05-26 23:43:00}" >o 2>e && echo "$E" >expect && test_cmp expect o && test_must_be_empty e ' -test_expect_success 'Query "master@{2005-05-28}" (past end of history)' ' +test_expect_success 'Query "main@{2005-05-28}" (past end of history)' ' test_when_finished "rm -f o e" && - git rev-parse --verify "master@{2005-05-28}" >o 2>e && + git rev-parse --verify "main@{2005-05-28}" >o 2>e && echo "$D" >expect && test_cmp expect o && test_i18ngrep -F "warning: log for ref $m unexpectedly ended on $ld" e @@ -467,14 +468,14 @@ test_expect_success 'git commit logged updates' ' ' unset h_TEST h_OTHER h_FIXED h_MERGED -test_expect_success 'git cat-file blob master:F (expect OTHER)' ' - test OTHER = $(git cat-file blob master:F) +test_expect_success 'git cat-file blob main:F (expect OTHER)' ' + test OTHER = $(git cat-file blob main:F) ' -test_expect_success 'git cat-file blob master@{2005-05-26 23:30}:F (expect TEST)' ' - test TEST = $(git cat-file blob "master@{2005-05-26 23:30}:F") +test_expect_success 'git cat-file blob main@{2005-05-26 23:30}:F (expect TEST)' ' + test TEST = $(git cat-file blob "main@{2005-05-26 23:30}:F") ' -test_expect_success 'git cat-file blob master@{2005-05-26 23:42}:F (expect OTHER)' ' - test OTHER = $(git cat-file blob "master@{2005-05-26 23:42}:F") +test_expect_success 'git cat-file blob main@{2005-05-26 23:42}:F (expect OTHER)' ' + test OTHER = $(git cat-file blob "main@{2005-05-26 23:42}:F") ' # Test adding and deleting pseudorefs @@ -586,21 +587,21 @@ test_expect_success 'stdin fails on unknown command' ' ' test_expect_success 'stdin fails on unbalanced quotes' ' - echo "create $a \"master" >stdin && + echo "create $a \"main" >stdin && test_must_fail git update-ref --stdin err && - grep "fatal: badly quoted argument: \\\"master" err + grep "fatal: badly quoted argument: \\\"main" err ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin fails on invalid escape' ' +test_expect_success 'stdin fails on invalid escape' ' echo "create $a \"ma\zn\"" >stdin && test_must_fail git update-ref --stdin err && grep "fatal: badly quoted argument: \\\"ma\\\\zn\\\"" err ' test_expect_success 'stdin fails on junk after quoted argument' ' - echo "create \"$a\"master" >stdin && + echo "create \"$a\"main" >stdin && test_must_fail git update-ref --stdin err && - grep "fatal: unexpected character after quoted argument: \\\"$a\\\"master" err + grep "fatal: unexpected character after quoted argument: \\\"$a\\\"main" err ' test_expect_success 'stdin fails create with no ref' ' @@ -710,7 +711,7 @@ test_expect_success 'stdin succeeds with quoted argument' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'stdin succeeds with escaped character' ' +test_expect_success 'stdin succeeds with escaped character' ' git update-ref -d $a && echo "create $a \"ma\\151n\"" >stdin && git update-ref --stdin X-Patchwork-Id: 11978847 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EFF8EC1B0D8 for ; Thu, 17 Dec 2020 01:08:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BD5B3233FD for ; Thu, 17 Dec 2020 01:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731307AbgLQBH5 (ORCPT ); Wed, 16 Dec 2020 20:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731291AbgLQBH4 (ORCPT ); Wed, 16 Dec 2020 20:07:56 -0500 Received: from mail-wm1-x329.google.com (mail-wm1-x329.google.com [IPv6:2a00:1450:4864:20::329]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CA1F9C0617A7 for ; Wed, 16 Dec 2020 17:07:15 -0800 (PST) Received: by mail-wm1-x329.google.com with SMTP id v14so4017235wml.1 for ; Wed, 16 Dec 2020 17:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=+EyJwZcTSTb4eONAc2wlveK1tquMm6mud1tx0+trD98=; b=m1hIaabGJfUzk405JTrRVFJVa/Rol8s+eUdNSaaxrPmrq7VvFkoY0I26YgVarlU2s5 9Gtmek5SvdEwpLMAm4ac914Tr0kUokYTc/rViB2BhwdX5UiH0ifvCdTj3Xw4tesQWI+o Y0DlksMLnMNtNpl9X4M2iFhqJJkSVWyJg86l+1sspon5GtlbyMN3I/0trzzumxqm/Alh L1ag/0HCWF3C4xOI4wwCmd+IBGn5gvIqYOdf/+T55Ng2jhKXELpN7wBKsm8WUxQNRvku IhnDOu2+j7bGKlbgF/rFYNW7XC9teROzEIpQ0E/JjSJq16x5zMgt2vrnUavKySDHlQRC QHQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=+EyJwZcTSTb4eONAc2wlveK1tquMm6mud1tx0+trD98=; b=VgaMuxbkxAtTBJnRP3hmu0o5ToypWnbDrBcSH4T+j0VdMKn9eWUYiXwpNTdiojxymL F1LOAY5l2BMYWT4HVcWx7OP9PO4lLN5W/kl5ZtzL67B2bm6/3/lwh3n4wfSjeEhsMLbw xdBQLXwEqGJKOIR4TkyPSAE2UOK/U6S53unpOBN95Odw/+BwC+fyiWXIp4iUK/QEWjWu MHHJfrsr3aO4H9Pg17OGeR8YzLJSDGVHDSmRqmp3WOlVJylkgGh+zhKzajCiECD4uwzB 9bYe4p38ud/uJR7rvk+KLWHMomBy1dVKnGtOMOzmn7sp/GpCR/bBcV05wyTO3YShLmDZ uUzQ== X-Gm-Message-State: AOAM532pzc+A9KqXXqQN7QDba1JlgfzAEImAQwte35YTSrInK/bOUcbC JK7TriwZtG3+P9KuXKao1Bjwq09HqNI= X-Google-Smtp-Source: ABdhPJz3naqYA70/jTJvmVDDZC7fCnBswPm9Lw/GlZodTShAoCSgdonfEtt7OF5ZaT6ZpUnWX9z3+g== X-Received: by 2002:a1c:c308:: with SMTP id t8mr5960395wmf.22.1608167233770; Wed, 16 Dec 2020 17:07:13 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id d15sm5733527wrx.93.2020.12.16.17.07.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:13 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:01 +0000 Subject: [PATCH 02/11] t3200: finish transitioning to the initial branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 56300ff356b (t3200: prepare for `main` being shorter than `master`, 2020-10-23) and in 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started to prepare t3200 for a new world where `git init` uses the branch name `main` for the initial branch. We do not even have to wait for that new world: we can easily ensure that that branch name is used, independent of the exact name `git init` will give the initial branch, so let's do that. This also lets us remove the `PREPARE_FOR_MAIN_BRANCH` prereq from three test cases in that script. Signed-off-by: Johannes Schindelin --- t/t3200-branch.sh | 265 +++++++++++++++++++++++----------------------- 1 file changed, 133 insertions(+), 132 deletions(-) diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index a0b832d59e6..3ec3e1d7303 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -12,6 +12,7 @@ test_expect_success 'prepare a trivial repository' ' echo Hello >A && git update-index --add A && git commit -m "Initial commit." && + git branch -M main && echo World >>A && git update-index --add A && git commit -m "Second commit." && @@ -27,8 +28,8 @@ test_expect_success 'branch -h in broken repository' ' mkdir broken && ( cd broken && - git init && - >.git/refs/heads/master && + git init -b main && + >.git/refs/heads/main && test_expect_code 129 git branch -h >usage 2>&1 ) && test_i18ngrep "[Uu]sage" broken/usage @@ -42,8 +43,8 @@ test_expect_success 'git branch a/b/c should create a branch' ' git branch a/b/c && test_path_is_file .git/refs/heads/a/b/c ' -test_expect_success 'git branch mb master... should create a branch' ' - git branch mb master... && test_path_is_file .git/refs/heads/mb +test_expect_success 'git branch mb main... should create a branch' ' + git branch mb main... && test_path_is_file .git/refs/heads/mb ' test_expect_success 'git branch HEAD should fail' ' @@ -51,7 +52,7 @@ test_expect_success 'git branch HEAD should fail' ' ' cat >expect < 1117150200 +0000 branch: Created from master +$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from main EOF test_expect_success 'git branch --create-reflog d/e/f should create a branch and a log' ' GIT_COMMITTER_DATE="2005-05-26 23:30" \ @@ -110,7 +111,7 @@ test_expect_success 'git branch -m n/n n should work' ' test_expect_success 'git branch -m bbb should rename checked out branch' ' test_when_finished git branch -D bbb && - test_when_finished git checkout master && + test_when_finished git checkout main && git checkout -b aaa && git commit --allow-empty -m "a new commit" && git rev-parse aaa@{0} >expect && @@ -124,7 +125,7 @@ test_expect_success 'git branch -m bbb should rename checked out branch' ' test_expect_success 'renaming checked out branch works with d/f conflict' ' test_when_finished "git branch -D foo/bar || git branch -D foo" && - test_when_finished git checkout master && + test_when_finished git checkout main && git checkout -b foo && git branch -m foo/bar && git symbolic-ref HEAD >actual && @@ -178,14 +179,14 @@ test_expect_success 'git branch -M baz bam should add entries to .git/logs/HEAD' ' test_expect_success 'git branch -M should leave orphaned HEAD alone' ' - git init orphan && + git init -b main orphan && ( cd orphan && test_commit initial && git checkout --orphan lonely && grep lonely .git/HEAD && test_path_is_missing .git/refs/head/lonely && - git branch -M master mistress && + git branch -M main mistress && grep lonely .git/HEAD ) ' @@ -201,7 +202,7 @@ test_expect_success 'resulting reflog can be shown by log -g' ' ' test_expect_success 'git branch -M baz bam should succeed when baz is checked out as linked working tree' ' - git checkout master && + git checkout main && git worktree add -b baz bazdir && git worktree add -f bazdir2 baz && git branch -M baz bam && @@ -224,18 +225,18 @@ test_expect_success 'git branch -M baz bam should succeed within a worktree in w git worktree prune ' -test_expect_success 'git branch -M master should work when master is checked out' ' - git checkout master && - git branch -M master +test_expect_success 'git branch -M main should work when main is checked out' ' + git checkout main && + git branch -M main ' -test_expect_success 'git branch -M master master should work when master is checked out' ' - git checkout master && - git branch -M master master +test_expect_success 'git branch -M main main should work when main is checked out' ' + git checkout main && + git branch -M main main ' -test_expect_success 'git branch -M topic topic should work when master is checked out' ' - git checkout master && +test_expect_success 'git branch -M topic topic should work when main is checked out' ' + git checkout main && git branch topic && git branch -M topic topic ' @@ -289,11 +290,11 @@ test_expect_success 'deleting checked-out branch from repo that is a submodule' test_expect_success 'bare main worktree has HEAD at branch deleted by secondary worktree' ' test_when_finished "rm -rf nonbare base secondary" && - git init nonbare && + git init -b main nonbare && test_commit -C nonbare x && git clone --bare nonbare bare && - git -C bare worktree add --detach ../secondary master && - git -C secondary branch -D master + git -C bare worktree add --detach ../secondary main && + git -C secondary branch -D main ' test_expect_success 'git branch --list -v with --abbrev' ' @@ -321,7 +322,7 @@ test_expect_success 'git branch --list -v with --abbrev' ' ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch --column' ' +test_expect_success 'git branch --column' ' COLUMNS=81 git branch --column=column >actual && cat >expect <<\EOF && a/b/c bam foo l * main n o/p r @@ -345,7 +346,7 @@ test_expect_success 'git branch --column with an extremely long branch name' ' j/k l m/m -* master +* main mb n o/o @@ -358,7 +359,7 @@ EOF test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch with column.*' ' +test_expect_success 'git branch with column.*' ' git config column.ui column && git config column.branch "dense" && COLUMNS=80 git branch >actual && @@ -375,7 +376,7 @@ test_expect_success 'git branch --column -v should fail' ' test_must_fail git branch --column -v ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignored' ' +test_expect_success 'git branch -v with column.ui ignored' ' git config column.ui column && COLUMNS=80 git branch -v | cut -c -8 | sed "s/ *$//" >actual && git config --unset column.ui && @@ -388,7 +389,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'git branch -v with column.ui ignore j/k l m/m -* master +* main mb n o/o @@ -427,8 +428,8 @@ test_expect_success 'config information was renamed, too' ' ' test_expect_success 'git branch -m correctly renames multiple config sections' ' - test_when_finished "git checkout master" && - git checkout -b source master && + test_when_finished "git checkout main" && + git checkout -b source main && # Assert that a config file with multiple config sections has # those sections preserved... @@ -587,18 +588,18 @@ test_expect_success 'git branch -C c1 c2 should never touch HEAD' ' ! grep "$msg$" .git/logs/HEAD ' -test_expect_success 'git branch -C master should work when master is checked out' ' - git checkout master && - git branch -C master +test_expect_success 'git branch -C main should work when main is checked out' ' + git checkout main && + git branch -C main ' -test_expect_success 'git branch -C master master should work when master is checked out' ' - git checkout master && - git branch -C master master +test_expect_success 'git branch -C main main should work when main is checked out' ' + git checkout main && + git branch -C main main ' -test_expect_success 'git branch -C main5 main5 should work when master is checked out' ' - git checkout master && +test_expect_success 'git branch -C main5 main5 should work when main is checked out' ' + git checkout main && git branch main5 && git branch -C main5 main5 ' @@ -620,8 +621,8 @@ test_expect_success 'git branch -C ab cd should overwrite existing config for cd test_expect_success 'git branch -c correctly copies multiple config sections' ' FOO=1 && export FOO && - test_when_finished "git checkout master" && - git checkout -b source2 master && + test_when_finished "git checkout main" && + git checkout -b source2 main && # Assert that a config file with multiple config sections has # those sections preserved... @@ -711,10 +712,10 @@ test_expect_success 'deleting a self-referential symref' ' ' test_expect_success 'renaming a symref is not allowed' ' - git symbolic-ref refs/heads/topic refs/heads/master && + git symbolic-ref refs/heads/topic refs/heads/main && test_must_fail git branch -m topic new-topic && git symbolic-ref refs/heads/topic && - test_path_is_file .git/refs/heads/master && + test_path_is_file .git/refs/heads/main && test_path_is_missing .git/refs/heads/new-topic ' @@ -728,27 +729,27 @@ test_expect_success SYMLINKS 'git branch -m u v should fail when the reflog for test_expect_success 'test tracking setup via --track' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track my1 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track my1 local/main && test $(git config branch.my1.remote) = local && - test $(git config branch.my1.merge) = refs/heads/master + test $(git config branch.my1.merge) = refs/heads/main ' test_expect_success 'test tracking setup (non-wildcard, matching)' ' git config remote.local.url . && - git config remote.local.fetch refs/heads/master:refs/remotes/local/master && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track my4 local/master && + git config remote.local.fetch refs/heads/main:refs/remotes/local/main && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track my4 local/main && test $(git config branch.my4.remote) = local && - test $(git config branch.my4.merge) = refs/heads/master + test $(git config branch.my4.merge) = refs/heads/main ' test_expect_success 'tracking setup fails on non-matching refspec' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git config remote.local.fetch refs/heads/s:refs/remotes/local/s && - test_must_fail git branch --track my5 local/master && + test_must_fail git branch --track my5 local/main && test_must_fail git config branch.my5.remote && test_must_fail git config branch.my5.merge ' @@ -757,21 +758,21 @@ test_expect_success 'test tracking setup via config' ' git config branch.autosetupmerge true && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch my3 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch my3 local/main && test $(git config branch.my3.remote) = local && - test $(git config branch.my3.merge) = refs/heads/master + test $(git config branch.my3.merge) = refs/heads/main ' test_expect_success 'test overriding tracking setup via --no-track' ' git config branch.autosetupmerge true && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track my2 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track my2 local/main && git config branch.autosetupmerge false && ! test "$(git config branch.my2.remote)" = local && - ! test "$(git config branch.my2.merge)" = refs/heads/master + ! test "$(git config branch.my2.merge)" = refs/heads/main ' test_expect_success 'no tracking without .fetch entries' ' @@ -836,26 +837,26 @@ test_expect_success 'branch from tag w/--track causes failure' ' test_expect_success '--set-upstream-to fails on multiple branches' ' echo "fatal: too many arguments to set new upstream" >expect && - test_must_fail git branch --set-upstream-to master a b c 2>err && + test_must_fail git branch --set-upstream-to main a b c 2>err && test_i18ncmp expect err ' test_expect_success '--set-upstream-to fails on detached HEAD' ' git checkout HEAD^{} && test_when_finished git checkout - && - echo "fatal: could not set upstream of HEAD to master when it does not point to any branch." >expect && - test_must_fail git branch --set-upstream-to master 2>err && + echo "fatal: could not set upstream of HEAD to main when it does not point to any branch." >expect && + test_must_fail git branch --set-upstream-to main 2>err && test_i18ncmp expect err ' test_expect_success '--set-upstream-to fails on a missing dst branch' ' echo "fatal: branch '"'"'does-not-exist'"'"' does not exist" >expect && - test_must_fail git branch --set-upstream-to master does-not-exist 2>err && + test_must_fail git branch --set-upstream-to main does-not-exist 2>err && test_i18ncmp expect err ' test_expect_success '--set-upstream-to fails on a missing src branch' ' - test_must_fail git branch --set-upstream-to does-not-exist master 2>err && + test_must_fail git branch --set-upstream-to does-not-exist main 2>err && test_i18ngrep "the requested upstream branch '"'"'does-not-exist'"'"' does not exist" err ' @@ -874,20 +875,20 @@ test_expect_success '--set-upstream-to fails on locked config' ' ' test_expect_success 'use --set-upstream-to modify HEAD' ' - test_config branch.master.remote foo && - test_config branch.master.merge foo && + test_config branch.main.remote foo && + test_config branch.main.merge foo && git branch my12 && git branch --set-upstream-to my12 && - test "$(git config branch.master.remote)" = "." && - test "$(git config branch.master.merge)" = "refs/heads/my12" + test "$(git config branch.main.remote)" = "." && + test "$(git config branch.main.merge)" = "refs/heads/my12" ' test_expect_success 'use --set-upstream-to modify a particular branch' ' git branch my13 && - git branch --set-upstream-to master my13 && + git branch --set-upstream-to main my13 && test_when_finished "git branch --unset-upstream my13" && test "$(git config branch.my13.remote)" = "." && - test "$(git config branch.my13.merge)" = "refs/heads/master" + test "$(git config branch.my13.merge)" = "refs/heads/main" ' test_expect_success '--unset-upstream should fail if given a non-existent branch' ' @@ -906,14 +907,14 @@ test_expect_success '--unset-upstream should fail if config is locked' ' test_expect_success 'test --unset-upstream on HEAD' ' git branch my14 && - test_config branch.master.remote foo && - test_config branch.master.merge foo && + test_config branch.main.remote foo && + test_config branch.main.merge foo && git branch --set-upstream-to my14 && git branch --unset-upstream && - test_must_fail git config branch.master.remote && - test_must_fail git config branch.master.merge && + test_must_fail git config branch.main.remote && + test_must_fail git config branch.main.merge && # fail for a branch without upstream set - echo "fatal: Branch '"'"'master'"'"' has no upstream information" >expect && + echo "fatal: Branch '"'"'main'"'"' has no upstream information" >expect && test_must_fail git branch --unset-upstream 2>err && test_i18ncmp expect err ' @@ -934,14 +935,14 @@ test_expect_success '--unset-upstream should fail on detached HEAD' ' test_expect_success 'test --unset-upstream on a particular branch' ' git branch my15 && - git branch --set-upstream-to master my14 && + git branch --set-upstream-to main my14 && git branch --unset-upstream my14 && test_must_fail git config branch.my14.remote && test_must_fail git config branch.my14.merge ' test_expect_success 'disabled option --set-upstream fails' ' - test_must_fail git branch --set-upstream origin/master + test_must_fail git branch --set-upstream origin/main ' test_expect_success '--set-upstream-to notices an error to set branch as own upstream' ' @@ -956,32 +957,32 @@ test_expect_success '--set-upstream-to notices an error to set branch as own ups # Keep this test last, as it changes the current branch cat >expect < 1117150200 +0000 branch: Created from master +$ZERO_OID $HEAD $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1117150200 +0000 branch: Created from main EOF test_expect_success 'git checkout -b g/h/i -l should create a branch and a log' ' GIT_COMMITTER_DATE="2005-05-26 23:30" \ - git checkout -b g/h/i -l master && + git checkout -b g/h/i -l main && test_path_is_file .git/refs/heads/g/h/i && test_path_is_file .git/logs/refs/heads/g/h/i && test_cmp expect .git/logs/refs/heads/g/h/i ' test_expect_success 'checkout -b makes reflog by default' ' - git checkout master && + git checkout main && git config --unset core.logAllRefUpdates && git checkout -b alpha && git rev-parse --verify alpha@{0} ' test_expect_success 'checkout -b does not make reflog when core.logAllRefUpdates = false' ' - git checkout master && + git checkout main && git config core.logAllRefUpdates false && git checkout -b beta && test_must_fail git rev-parse --verify beta@{0} ' test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates = false' ' - git checkout master && + git checkout main && git checkout -lb gamma && git config --unset core.logAllRefUpdates && git rev-parse --verify gamma@{0} @@ -990,10 +991,10 @@ test_expect_success 'checkout -b with -l makes reflog when core.logAllRefUpdates test_expect_success 'avoid ambiguous track' ' git config branch.autosetupmerge true && git config remote.ambi1.url lalala && - git config remote.ambi1.fetch refs/heads/lalala:refs/heads/master && + git config remote.ambi1.fetch refs/heads/lalala:refs/heads/main && git config remote.ambi2.url lilili && - git config remote.ambi2.fetch refs/heads/lilili:refs/heads/master && - test_must_fail git branch all1 master && + git config remote.ambi2.fetch refs/heads/lilili:refs/heads/main && + test_must_fail git branch all1 main && test -z "$(git config branch.all1.merge)" ' @@ -1049,10 +1050,10 @@ test_expect_success 'autosetuprebase local on a tracked remote branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && git config branch.autosetuprebase local && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track myr5 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track myr5 local/main && test "$(git config branch.myr5.remote)" = local && - test "$(git config branch.myr5.merge)" = refs/heads/master && + test "$(git config branch.myr5.merge)" = refs/heads/main && ! test "$(git config branch.myr5.rebase)" = true ' @@ -1060,10 +1061,10 @@ test_expect_success 'autosetuprebase never on a tracked remote branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && git config branch.autosetuprebase never && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track myr6 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track myr6 local/main && test "$(git config branch.myr6.remote)" = local && - test "$(git config branch.myr6.merge)" = refs/heads/master && + test "$(git config branch.myr6.merge)" = refs/heads/main && ! test "$(git config branch.myr6.rebase)" = true ' @@ -1071,10 +1072,10 @@ test_expect_success 'autosetuprebase remote on a tracked remote branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && git config branch.autosetuprebase remote && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track myr7 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track myr7 local/main && test "$(git config branch.myr7.remote)" = local && - test "$(git config branch.myr7.merge)" = refs/heads/master && + test "$(git config branch.myr7.merge)" = refs/heads/main && test "$(git config branch.myr7.rebase)" = true ' @@ -1082,10 +1083,10 @@ test_expect_success 'autosetuprebase always on a tracked remote branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && git config branch.autosetuprebase remote && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track myr8 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track myr8 local/main && test "$(git config branch.myr8.remote)" = local && - test "$(git config branch.myr8.merge)" = refs/heads/master && + test "$(git config branch.myr8.merge)" = refs/heads/main && test "$(git config branch.myr8.rebase)" = true ' @@ -1093,10 +1094,10 @@ test_expect_success 'autosetuprebase unconfigured on a tracked remote branch' ' git config --unset branch.autosetuprebase && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --track myr9 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --track myr9 local/main && test "$(git config branch.myr9.remote)" = local && - test "$(git config branch.myr9.merge)" = refs/heads/master && + test "$(git config branch.myr9.merge)" = refs/heads/main && test "z$(git config branch.myr9.rebase)" = z ' @@ -1114,7 +1115,7 @@ test_expect_success 'autosetuprebase unconfigured on a tracked local branch' ' test_expect_success 'autosetuprebase unconfigured on untracked local branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git branch --no-track myr11 mybase2 && test "z$(git config branch.myr11.remote)" = z && test "z$(git config branch.myr11.merge)" = z && @@ -1124,8 +1125,8 @@ test_expect_success 'autosetuprebase unconfigured on untracked local branch' ' test_expect_success 'autosetuprebase unconfigured on untracked remote branch' ' git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track myr12 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track myr12 local/main && test "z$(git config branch.myr12.remote)" = z && test "z$(git config branch.myr12.merge)" = z && test "z$(git config branch.myr12.rebase)" = z @@ -1135,7 +1136,7 @@ test_expect_success 'autosetuprebase never on an untracked local branch' ' git config branch.autosetuprebase never && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git branch --no-track myr13 mybase2 && test "z$(git config branch.myr13.remote)" = z && test "z$(git config branch.myr13.merge)" = z && @@ -1146,7 +1147,7 @@ test_expect_success 'autosetuprebase local on an untracked local branch' ' git config branch.autosetuprebase local && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git branch --no-track myr14 mybase2 && test "z$(git config branch.myr14.remote)" = z && test "z$(git config branch.myr14.merge)" = z && @@ -1157,7 +1158,7 @@ test_expect_success 'autosetuprebase remote on an untracked local branch' ' git config branch.autosetuprebase remote && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git branch --no-track myr15 mybase2 && test "z$(git config branch.myr15.remote)" = z && test "z$(git config branch.myr15.merge)" = z && @@ -1168,7 +1169,7 @@ test_expect_success 'autosetuprebase always on an untracked local branch' ' git config branch.autosetuprebase always && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && + (git show-ref -q refs/remotes/local/main || git fetch local) && git branch --no-track myr16 mybase2 && test "z$(git config branch.myr16.remote)" = z && test "z$(git config branch.myr16.merge)" = z && @@ -1179,8 +1180,8 @@ test_expect_success 'autosetuprebase never on an untracked remote branch' ' git config branch.autosetuprebase never && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track myr17 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track myr17 local/main && test "z$(git config branch.myr17.remote)" = z && test "z$(git config branch.myr17.merge)" = z && test "z$(git config branch.myr17.rebase)" = z @@ -1190,8 +1191,8 @@ test_expect_success 'autosetuprebase local on an untracked remote branch' ' git config branch.autosetuprebase local && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track myr18 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track myr18 local/main && test "z$(git config branch.myr18.remote)" = z && test "z$(git config branch.myr18.merge)" = z && test "z$(git config branch.myr18.rebase)" = z @@ -1201,8 +1202,8 @@ test_expect_success 'autosetuprebase remote on an untracked remote branch' ' git config branch.autosetuprebase remote && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track myr19 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track myr19 local/main && test "z$(git config branch.myr19.remote)" = z && test "z$(git config branch.myr19.merge)" = z && test "z$(git config branch.myr19.rebase)" = z @@ -1212,8 +1213,8 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' ' git config branch.autosetuprebase always && git config remote.local.url . && git config remote.local.fetch refs/heads/*:refs/remotes/local/* && - (git show-ref -q refs/remotes/local/master || git fetch local) && - git branch --no-track myr20 local/master && + (git show-ref -q refs/remotes/local/main || git fetch local) && + git branch --no-track myr20 local/main && test "z$(git config branch.myr20.remote)" = z && test "z$(git config branch.myr20.merge)" = z && test "z$(git config branch.myr20.rebase)" = z @@ -1221,7 +1222,7 @@ test_expect_success 'autosetuprebase always on an untracked remote branch' ' test_expect_success 'autosetuprebase always on detached HEAD' ' git config branch.autosetupmerge always && - test_when_finished git checkout master && + test_when_finished git checkout main && git checkout HEAD^0 && git branch my11 && test -z "$(git config branch.my11.remote)" && @@ -1249,18 +1250,18 @@ test_expect_success 'attempt to delete a branch without base and unmerged to HEA test_expect_success 'attempt to delete a branch merged to its base' ' # we are on my9 which is the initial commit; traditionally # we would not have allowed deleting my8 that is not merged - # to my9, but it is set to track master that already has my8 - git config branch.my8.merge refs/heads/master && + # to my9, but it is set to track main that already has my8 + git config branch.my8.merge refs/heads/main && git branch -d my8 ' test_expect_success 'attempt to delete a branch merged to its base' ' - git checkout master && + git checkout main && echo Third >>A && git commit -m "Third commit" A && git branch -t my10 my9 && git branch -f my10 HEAD^ && - # we are on master which is at the third commit, and my10 + # we are on main which is at the third commit, and my10 # is behind us, so traditionally we would have allowed deleting # it; but my10 is set to track my9 that is further behind. test_must_fail git branch -d my10 @@ -1287,7 +1288,7 @@ test_expect_success 'detect typo in branch name when using --edit-description' ' ' test_expect_success 'refuse --edit-description on unborn branch for now' ' - test_when_finished "git checkout master" && + test_when_finished "git checkout main" && write_script editor <<-\EOF && echo "New contents" >"$1" EOF @@ -1301,18 +1302,18 @@ test_expect_success '--merged catches invalid object names' ' test_expect_success '--list during rebase' ' test_when_finished "reset_rebase" && - git checkout master && + git checkout main && FAKE_LINES="1 edit 2" && export FAKE_LINES && set_fake_editor && git rebase -i HEAD~2 && git branch --list >actual && - test_i18ngrep "rebasing master" actual + test_i18ngrep "rebasing main" actual ' test_expect_success '--list during rebase from detached HEAD' ' - test_when_finished "reset_rebase && git checkout master" && - git checkout master^0 && + test_when_finished "reset_rebase && git checkout main" && + git checkout main^0 && oid=$(git rev-parse --short HEAD) && FAKE_LINES="1 edit 2" && export FAKE_LINES && @@ -1324,17 +1325,17 @@ test_expect_success '--list during rebase from detached HEAD' ' test_expect_success 'tracking with unexpected .fetch refspec' ' rm -rf a b c d && - git init a && + git init -b main a && ( cd a && test_commit a ) && - git init b && + git init -b main b && ( cd b && test_commit b ) && - git init c && + git init -b main c && ( cd c && test_commit c && @@ -1342,23 +1343,23 @@ test_expect_success 'tracking with unexpected .fetch refspec' ' git remote add b ../b && git fetch --all ) && - git init d && + git init -b main d && ( cd d && git remote add c ../c && git config remote.c.fetch "+refs/remotes/*:refs/remotes/*" && git fetch c && - git branch --track local/a/master remotes/a/master && - test "$(git config branch.local/a/master.remote)" = "c" && - test "$(git config branch.local/a/master.merge)" = "refs/remotes/a/master" && + git branch --track local/a/main remotes/a/main && + test "$(git config branch.local/a/main.remote)" = "c" && + test "$(git config branch.local/a/main.merge)" = "refs/remotes/a/main" && git rev-parse --verify a >expect && - git rev-parse --verify local/a/master >actual && + git rev-parse --verify local/a/main >actual && test_cmp expect actual ) ' test_expect_success 'configured committerdate sort' ' - git init sort && + git init -b main sort && ( cd sort && git config branch.sort committerdate && @@ -1371,7 +1372,7 @@ test_expect_success 'configured committerdate sort' ' test_commit b && git branch >actual && cat >expect <<-\EOF && - master + main a c * b @@ -1389,7 +1390,7 @@ test_expect_success 'option override configured sort' ' a * b c - master + main EOF test_cmp expect actual ) From patchwork Thu Dec 17 01:07:02 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978849 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 157A5C0018C for ; Thu, 17 Dec 2020 01:08:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DF121233F6 for ; Thu, 17 Dec 2020 01:08:11 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731302AbgLQBH5 (ORCPT ); Wed, 16 Dec 2020 20:07:57 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731292AbgLQBH4 (ORCPT ); Wed, 16 Dec 2020 20:07:56 -0500 Received: from mail-wr1-x431.google.com (mail-wr1-x431.google.com [IPv6:2a00:1450:4864:20::431]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0813DC0617B0 for ; Wed, 16 Dec 2020 17:07:15 -0800 (PST) Received: by mail-wr1-x431.google.com with SMTP id d13so6664414wrc.13 for ; Wed, 16 Dec 2020 17:07:15 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=iYSibgb8dt6FGiFQDH1NBfzA5DS8VRrp7uoVXpuqbP4=; b=tRYnMbcYscmuKMUxKkUgGFkuq4A3uIX2xEKHYKiWEFL62ak9S8yxWDtOMpVhrOXYu6 cCrU5B2q0kbzOmwGHFPIVkMZ8lM3FjM5ykIQUZOgAS8gmT+ER7KO2hG9V+aEVBj/DQZ8 x1aOoZnBKCqNAWilewCVOn6rP7ubcFuhqfJdX0WPRElsWpS6u2ObKwQxDORNDxnZU1wB oNIo/SjSYISKr8KIiiBtlR/iT55kJxhvsPhlo70pVf9VGRjU8I3dFm7Rmv42oiYiCY9f ASqt+0G650Vtl5AJfrUzCp0HKNjVZ2c3UdoFtmz3J/Rr4PHnT6Tfa7auX1bDKWG3uX/Q SiSg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=iYSibgb8dt6FGiFQDH1NBfzA5DS8VRrp7uoVXpuqbP4=; b=dEv1vm1A/Zy2PshOOm2VrgWDKAo00bDFZssBfg0n7omkIiKSZzs3U/PBVEKfrMsxwH Lj4VoQEsmyqeVgpoPyNGwOyOZiHw0DJF6TdLBqLi91plbIFcy1qZPNoEsmJxWrf4gqZR 7NFAJMXpkmrnQs9N6lC0reINI+u63bGVCsFayJ3R9dtcHSucdJdU6MiEe279XFneIKrR 52kfo6YiVuDtrWjwLl2hkwOPOx5mE2J+eNt+IvPktGKOnXgOULF8Sjx6MIK9gkSYiShM xpL/THhg9qkX0uS+xYTeOrEYy+/ABbdcDPBaF1KyOZg/J8KGwnRju+AtEI7ZedJPtdAS K5Ug== X-Gm-Message-State: AOAM532oK9kkn9t1W1yR+CxJnls7UONhSC/Bh3zNzCDHWSBZaDm174aN nAzP9YzAgBFY00xJWtv7b91l5dXnU4Q= X-Google-Smtp-Source: ABdhPJy3qMj1YofUTVdEqvM3NC+TAFEN68V62biz7hID3k4/wXYtXGTnrWM65hVUQXs2meP+AooLSw== X-Received: by 2002:a5d:504d:: with SMTP id h13mr41489798wrt.246.1608167234465; Wed, 16 Dec 2020 17:07:14 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id n8sm5779473wrs.34.2020.12.16.17.07.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:14 -0800 (PST) Message-Id: <4360881016dd204c63288ee04588db1a469a6752.1608167230.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:02 +0000 Subject: [PATCH 03/11] t3201: finalize transitioning to using the branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started that transition, trying to prepare for a time when `git init` would use that name for the initial branch. Even if that time has not arrived, we can complete the transition by making the test script independent of the default branch name. This also allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test case. Signed-off-by: Johannes Schindelin --- t/t3201-branch-contains.sh | 83 +++++++++++++++++++------------------- 1 file changed, 42 insertions(+), 41 deletions(-) diff --git a/t/t3201-branch-contains.sh b/t/t3201-branch-contains.sh index 3733cd0091e..6c1ab69ca6d 100755 --- a/t/t3201-branch-contains.sh +++ b/t/t3201-branch-contains.sh @@ -10,51 +10,52 @@ test_expect_success setup ' git add file && test_tick && git commit -m initial && + git branch -M main && git branch side && echo 1 >file && test_tick && - git commit -a -m "second on master" && + git commit -a -m "second on main" && git checkout side && echo 1 >file && test_tick && git commit -a -m "second on side" && - git merge master + git merge main ' -test_expect_success 'branch --contains=master' ' +test_expect_success 'branch --contains=main' ' - git branch --contains=master >actual && + git branch --contains=main >actual && { - echo " master" && echo "* side" + echo " main" && echo "* side" } >expect && test_cmp expect actual ' -test_expect_success 'branch --contains master' ' +test_expect_success 'branch --contains main' ' - git branch --contains master >actual && + git branch --contains main >actual && { - echo " master" && echo "* side" + echo " main" && echo "* side" } >expect && test_cmp expect actual ' -test_expect_success 'branch --no-contains=master' ' +test_expect_success 'branch --no-contains=main' ' - git branch --no-contains=master >actual && + git branch --no-contains=main >actual && test_must_be_empty actual ' -test_expect_success 'branch --no-contains master' ' +test_expect_success 'branch --no-contains main' ' - git branch --no-contains master >actual && + git branch --no-contains main >actual && test_must_be_empty actual ' @@ -73,7 +74,7 @@ test_expect_success 'branch --no-contains=side' ' git branch --no-contains=side >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -81,9 +82,9 @@ test_expect_success 'branch --no-contains=side' ' test_expect_success 'branch --contains with pattern implies --list' ' - git branch --contains=master master >actual && + git branch --contains=main main >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -91,7 +92,7 @@ test_expect_success 'branch --contains with pattern implies --list' ' test_expect_success 'branch --no-contains with pattern implies --list' ' - git branch --no-contains=master master >actual && + git branch --no-contains=main main >actual && test_must_be_empty actual ' @@ -100,7 +101,7 @@ test_expect_success 'side: branch --merged' ' git branch --merged >actual && { - echo " master" && + echo " main" && echo "* side" } >expect && test_cmp expect actual @@ -109,9 +110,9 @@ test_expect_success 'side: branch --merged' ' test_expect_success 'branch --merged with pattern implies --list' ' - git branch --merged=side master >actual && + git branch --merged=side main >actual && { - echo " master" + echo " main" } >expect && test_cmp expect actual @@ -124,18 +125,18 @@ test_expect_success 'side: branch --no-merged' ' ' -test_expect_success 'master: branch --merged' ' +test_expect_success 'main: branch --merged' ' - git checkout master && + git checkout main && git branch --merged >actual && { - echo "* master" + echo "* main" } >expect && test_cmp expect actual ' -test_expect_success 'master: branch --no-merged' ' +test_expect_success 'main: branch --no-merged' ' git branch --no-merged >actual && { @@ -147,22 +148,22 @@ test_expect_success 'master: branch --no-merged' ' test_expect_success 'branch --no-merged with pattern implies --list' ' - git branch --no-merged=master master >actual && + git branch --no-merged=main main >actual && test_must_be_empty actual ' test_expect_success 'implicit --list conflicts with modification options' ' - test_must_fail git branch --contains=master -d && - test_must_fail git branch --contains=master -m foo && - test_must_fail git branch --no-contains=master -d && - test_must_fail git branch --no-contains=master -m foo + test_must_fail git branch --contains=main -d && + test_must_fail git branch --contains=main -m foo && + test_must_fail git branch --no-contains=main -d && + test_must_fail git branch --no-contains=main -m foo ' test_expect_success 'Assert that --contains only works on commits, not trees & blobs' ' - test_must_fail git branch --contains master^{tree} && + test_must_fail git branch --contains main^{tree} && blob=$(git hash-object -w --stdin <<-\EOF Some blob EOF @@ -172,11 +173,11 @@ test_expect_success 'Assert that --contains only works on commits, not trees & b ' test_expect_success 'multiple branch --contains' ' - git checkout -b side2 master && + git checkout -b side2 main && >feature && git add feature && git commit -m "add feature" && - git checkout -b next master && + git checkout -b next main && git merge side && git branch --contains side --contains side2 >actual && cat >expect <<-\EOF && @@ -188,9 +189,9 @@ test_expect_success 'multiple branch --contains' ' ' test_expect_success 'multiple branch --merged' ' - git branch --merged next --merged master >actual && + git branch --merged next --merged main >actual && cat >expect <<-\EOF && - master + main * next side EOF @@ -200,13 +201,13 @@ test_expect_success 'multiple branch --merged' ' test_expect_success 'multiple branch --no-contains' ' git branch --no-contains side --no-contains side2 >actual && cat >expect <<-\EOF && - master + main EOF test_cmp expect actual ' test_expect_success 'multiple branch --no-merged' ' - git branch --no-merged next --no-merged master >actual && + git branch --no-merged next --no-merged main >actual && cat >expect <<-\EOF && side2 EOF @@ -214,7 +215,7 @@ test_expect_success 'multiple branch --no-merged' ' ' test_expect_success 'branch --contains combined with --no-contains' ' - git checkout -b seen master && + git checkout -b seen main && git merge side && git merge side2 && git branch --contains side --no-contains side2 >actual && @@ -239,17 +240,17 @@ test_expect_success 'branch --merged combined with --no-merged' ' # that the latter walk does not mess up our flag to see if it was # merged). # -# Here "topic" tracks "master" with one extra commit, and "zzz" points to the -# same tip as master The name "zzz" must come alphabetically after "topic" +# Here "topic" tracks "main" with one extra commit, and "zzz" points to the +# same tip as main The name "zzz" must come alphabetically after "topic" # as we process them in that order. -test_expect_success PREPARE_FOR_MAIN_BRANCH 'branch --merged with --verbose' ' - git branch --track topic master && +test_expect_success 'branch --merged with --verbose' ' + git branch --track topic main && git branch zzz topic && git checkout topic && test_commit foo && git branch --merged topic >actual && cat >expect <<-\EOF && - master + main * topic zzz EOF From patchwork Thu Dec 17 01:07:03 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978853 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDB60C1B0D8 for ; Thu, 17 Dec 2020 01:08:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id AEDC622D74 for ; Thu, 17 Dec 2020 01:08:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732309AbgLQBIi (ORCPT ); Wed, 16 Dec 2020 20:08:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54338 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727933AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6436C06138C for ; Wed, 16 Dec 2020 17:07:16 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id g185so4125197wmf.3 for ; Wed, 16 Dec 2020 17:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=+lOQKUPmSBEDPkKrvskIPeD+ShJQK4Gm5nvaMGGK4kA=; b=mw/VOosRtaGA2l4A63lyWP0wivZRAoUOkV7HeXsJbV9erCd46sO3JVdR822DDGIANi eroLzZV7Er7wHLFyxhZwL6nkv+Lh6cbsRR2FRXxumzoS6OwBxaMwDmXsZALz1LSqX8uR pPKNBtvc6ZHvZj+nINoBGC69ot7AgGVi5l6Bshz4XqOceoMsxzk3y+veLNoe3eLiicQd HpGr2+KfH5BdlA8y98c3XfpX8MlJb1RXCleU8gN1uhobzOqHFQXc96s9ITupOUt0wvNm 0wfy9NVwhBaLhhTvDXqIB/U0sZ0tFOBNgX7c7oCXeuyly2K4ocjp7/l6pCKpi+1BoOGF 477g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=+lOQKUPmSBEDPkKrvskIPeD+ShJQK4Gm5nvaMGGK4kA=; b=QVKo0vPJQDoRNqizstb/V6AWbxV+uTlXEpfzNXaoDs11h87IUeCl2xeINt1Fw1R7ru Y1keOgXCoYBIOqyMO5uG+wIE40/rVaAfNO75wo5piH6Wag1zhNGg7iFQAYRhiEheScgv pDwIiIYWj542rqtnfUiwetRzyeRyCLylQKrtYhE/6g+x2VDH/j7fcCo8u1S/y3QyDycE cDzeCOzdX175Cj/oKQiQYZs9V23mHvRRMyE9EoYzI8GJEum2PhMgj5p1u5JLFXoI1KoY jZsR/lmtksc7TZCbYymA1fc7qs9TYHJcvL7GcltsaH95DGzWLdd51xNV38gGOibUdO+1 lv+Q== X-Gm-Message-State: AOAM532C4urDskobqahXTumbV1b1T+UjAQ9ttrsSBnA3KZlj3oCcNW1j QiEYSX2Ap28Gbf9codLbBXFXUXwLsrU= X-Google-Smtp-Source: ABdhPJz15AMUOygftJwn2jORGfULUQ8/LhjG4M6AEvk75oYIS4VdwsbqcicMqX1i8TtslALOEaSdzg== X-Received: by 2002:a1c:7703:: with SMTP id t3mr5872896wmi.47.1608167235398; Wed, 16 Dec 2020 17:07:15 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id y130sm5563495wmc.22.2020.12.16.17.07.14 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:14 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:03 +0000 Subject: [PATCH 04/11] t3203: complete the transition to using the branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started that transition, trying to prepare for a time when `git init` would use that name for the initial branch. Even if that time has not arrived, we can complete the transition by making the test script independent of the default branch name. This also allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test case. Signed-off-by: Johannes Schindelin --- t/t3203-branch-output.sh | 43 ++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 21 deletions(-) diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh index d65586541d2..b945faf4702 100755 --- a/t/t3203-branch-output.sh +++ b/t/t3203-branch-output.sh @@ -8,6 +8,7 @@ test_expect_success 'make commits' ' echo content >file && git add file && git commit -m one && + git branch -M main && echo content >>file && git commit -a -m two ' @@ -26,7 +27,7 @@ test_expect_success 'make remote branches' ' cat >expect <<'EOF' branch-one branch-two -* master +* main EOF test_expect_success 'git branch shows local branches' ' git branch >actual && @@ -60,7 +61,7 @@ test_expect_success 'git branch -r shows remote branches' ' cat >expect <<'EOF' branch-one branch-two -* master +* main remotes/origin/HEAD -> origin/branch-one remotes/origin/branch-one remotes/origin/branch-two @@ -152,7 +153,7 @@ test_expect_success 'git branch shows detached HEAD properly' ' * (HEAD detached at $(git rev-parse --short HEAD^0)) branch-one branch-two - master + main EOF git checkout HEAD^0 && git branch >actual && @@ -160,12 +161,12 @@ EOF ' test_expect_success 'git branch shows detached HEAD properly after checkout --detach' ' - git checkout master && + git checkout main && cat >expect <actual && @@ -177,7 +178,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving' ' * (HEAD detached from $(git rev-parse --short HEAD)) branch-one branch-two - master + main EOF git reset --hard HEAD^1 && git branch >actual && @@ -189,9 +190,9 @@ test_expect_success 'git branch shows detached HEAD properly from tag' ' * (HEAD detached at fromtag) branch-one branch-two - master + main EOF - git tag fromtag master && + git tag fromtag main && git checkout fromtag && git branch >actual && test_i18ncmp expect actual @@ -202,7 +203,7 @@ test_expect_success 'git branch shows detached HEAD properly after moving from t * (HEAD detached from fromtag) branch-one branch-two - master + main EOF git reset --hard HEAD^1 && git branch >actual && @@ -214,7 +215,7 @@ test_expect_success 'git branch `--sort` option' ' * (HEAD detached from fromtag) branch-two branch-one - master + main EOF git branch --sort=objectsize >actual && test_i18ncmp expect actual @@ -223,7 +224,7 @@ test_expect_success 'git branch `--sort` option' ' test_expect_success 'git branch --points-at option' ' cat >expect <<-\EOF && branch-one - master + main EOF git branch --points-at=branch-one >actual && test_cmp expect actual @@ -251,7 +252,7 @@ test_expect_success 'local-branch symrefs shortened properly' ' test_expect_success 'sort branches, ignore case' ' ( - git init sort-icase && + git init -b main sort-icase && cd sort-icase && test_commit initial && git branch branch-one && @@ -260,14 +261,14 @@ test_expect_success 'sort branches, ignore case' ' cat >expected <<-\EOF && BRANCH-two branch-one - master + main EOF test_cmp expected actual && git branch --list -i | awk "{print \$NF}" >actual && cat >expected <<-\EOF && branch-one BRANCH-two - master + main EOF test_cmp expected actual ) @@ -279,7 +280,7 @@ test_expect_success 'git branch --format option' ' Refname is refs/heads/ambiguous Refname is refs/heads/branch-one Refname is refs/heads/branch-two - Refname is refs/heads/master + Refname is refs/heads/main Refname is refs/heads/ref-to-branch Refname is refs/heads/ref-to-remote EOF @@ -293,7 +294,7 @@ test_expect_success 'worktree colors correct' ' ambiguous branch-one + branch-two - master + main ref-to-branch -> branch-one ref-to-remote -> origin/branch-one EOF @@ -306,9 +307,9 @@ test_expect_success 'worktree colors correct' ' ' test_expect_success "set up color tests" ' - echo "master" >expect.color && - echo "master" >expect.bare && - color_args="--format=%(color:red)%(refname:short) --list master" + echo "main" >expect.color && + echo "main" >expect.bare && + color_args="--format=%(color:red)%(refname:short) --list main" ' test_expect_success '%(color) omitted without tty' ' @@ -329,9 +330,9 @@ test_expect_success '--color overrides auto-color' ' test_cmp expect.color actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output lists worktree path' ' +test_expect_success 'verbose output lists worktree path' ' one=$(git rev-parse --short HEAD) && - two=$(git rev-parse --short master) && + two=$(git rev-parse --short main) && cat >expect <<-EOF && * (HEAD detached from fromtag) $one one ambiguous $one one From patchwork Thu Dec 17 01:07:04 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978859 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id F0979C0018C for ; Thu, 17 Dec 2020 01:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BC607233F9 for ; Thu, 17 Dec 2020 01:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731825AbgLQBIh (ORCPT ); Wed, 16 Dec 2020 20:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54340 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727806AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wr1-x429.google.com (mail-wr1-x429.google.com [IPv6:2a00:1450:4864:20::429]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9455BC061282 for ; Wed, 16 Dec 2020 17:07:17 -0800 (PST) Received: by mail-wr1-x429.google.com with SMTP id a12so24883767wrv.8 for ; Wed, 16 Dec 2020 17:07:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=e1aYPUeZjYhucSYPBW1QQtqRTPWqnRACjXwG2b865HA=; b=n/jyk4xWbkZb4eN9yCpKEu6LL/oztZZogMXVXKqUBQBhqKoRVNHj7VszN7vPmwtreX dTKygJ53UgINf0xG3TgTuogwlWWzESJiF1znUjYsxk8g5BjOE2eOqkfz69ejh9LR7Ru1 Cz8mElSo/pez+byaC9zkOL0gWkvqQJoFvBVEklN4q4Or2m4UhHB5n3Qn3qU7VRRmhvd6 pOwVryByZ8mplUReCsc7OO8GiAzvpx/onW3JpLKUzIEQtEu3VE05KYplZpRhiv03G8qe EM4GitOSrXvaXuBgO4T0etWgywjZXK246tEMqz9q+UY1GCy2xvnpc491l4z/beufvSBe Y+Mw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=e1aYPUeZjYhucSYPBW1QQtqRTPWqnRACjXwG2b865HA=; b=NTVHR0rVh8RjAMMyEZSbSgS9I0uLZ3XAL+Yz7ThFVj2GndECXFx33MKpC3SHICyG4q adQnnwdHuMfNWdZx9X4alRqKj8aPx20AQ15IvpEGwOJuAR8RNn46jyPueaOcRFbrCNSR sZhealkc4LWDLD7Aq5Gd2E0REVqqxESXbc77YcnQEYjtM7EREpMUcRsmNKBojAfwpsHp LNjAREkTVCqgdP7shzdncOk+IpYPgHM7fQo5SYG06DzgjcjLKpu8emNBjJ7gJ3QV4EOx e7KfcHiNgP9mXWS6oo80LVXBBRcK4Iqb1BK7UqzxssOxCo9SpqyRNiX3vzbva8UFGdAG Fy5g== X-Gm-Message-State: AOAM531aL92zmn0H2JH3Tzx6WD22vdxi2K+OPCI1rgtcX6QQZN/xkmzN 3WgI1bt54n4Klnu/Urmtmi+9dLuwEtE= X-Google-Smtp-Source: ABdhPJxQs3TVIHEAY4X7sAi+3uGeDTWtIkd6a5p1+i71dysr7daZ6Sz6EgPfrH7baa4JmBKHTjqc8w== X-Received: by 2002:a5d:5401:: with SMTP id g1mr40454211wrv.93.1608167236250; Wed, 16 Dec 2020 17:07:16 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k1sm5791657wrn.46.2020.12.16.17.07.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:15 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:04 +0000 Subject: [PATCH 05/11] t3205: finalize transitioning to using the branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started that transition, trying to prepare for a time when `git init` would use that name for the initial branch. Even if that time has not arrived, we can complete the transition by making the test script independent of the default branch name. This also allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test case. Signed-off-by: Johannes Schindelin --- t/t3205-branch-color.sh | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/t/t3205-branch-color.sh b/t/t3205-branch-color.sh index 289625c4646..da1c202fa71 100755 --- a/t/t3205-branch-color.sh +++ b/t/t3205-branch-color.sh @@ -5,7 +5,8 @@ test_description='basic branch output coloring' test_expect_success 'set up some sample branches' ' test_commit foo && - git update-ref refs/remotes/origin/master HEAD && + git branch -M main && + git update-ref refs/remotes/origin/main HEAD && git update-ref refs/heads/other HEAD ' @@ -19,16 +20,16 @@ test_expect_success 'set up some color config' ' test_expect_success 'regular output shows colors' ' cat >expect <<-\EOF && - * master + * main other - remotes/origin/master + remotes/origin/main EOF git branch --color -a >actual.raw && test_decode_color actual && test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'verbose output shows colors' ' +test_expect_success 'verbose output shows colors' ' oid=$(git rev-parse --short HEAD) && cat >expect <<-EOF && * main $oid foo From patchwork Thu Dec 17 01:07:05 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978851 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-17.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,MENTIONS_GIT_HOSTING,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id BE7CEC4361B for ; Thu, 17 Dec 2020 01:08:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 84FEC22D74 for ; Thu, 17 Dec 2020 01:08:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731570AbgLQBIh (ORCPT ); Wed, 16 Dec 2020 20:08:37 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54342 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728730AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DB0BAC061285 for ; Wed, 16 Dec 2020 17:07:18 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id a6so4010453wmc.2 for ; Wed, 16 Dec 2020 17:07:18 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=ce/+XLBF6gWeMEhbb4WeY+df//Iyc6K1tSN1HEo2i5k=; b=Bzhq0KgpyO+ZR66qmNP30HiMn+7m9kZjM3TGYeXzsugfQZQf18mLcoPkbaECklRymO leGi6TApPdSmYF7y3TVb+p9lkZ5CQc01rfV4auEF6Wn9l8Pb35XuKdIp8ERYxU5r9uc5 L3elTYNQqdhcQNpCBAXZS7oeAzKzeeRoCeXyzht3XU2MnxknVimvqRWDMp1n0SLfe+D5 RP4O4fjcZzBYE62gE1j6pZUuPFQPDMGOF/Fx33/G81VqKQaQTkNYBLUD6jkxMtfaE5oA TE2gKhteHPyGdFgoXf9zxemrFDDRAedXirNeMWYuldN0gc3dMSKYs5rn91/p2g9XoyG7 n57w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=ce/+XLBF6gWeMEhbb4WeY+df//Iyc6K1tSN1HEo2i5k=; b=FZeLancmYrJqMCN5ocrGR1TnRabmORZTC4Hq2svyrgKxlHObEDNiQxCC+j5fuZRsPK yFUFeBmFHQmpDRUwozcgQWZp/g3/WIFI/F/3xMjtVh2N2viwvy1TyIlk3bL1cyFANnAk P+RzmZp7v8HXh+SZ1SgHr/4lbpKTFRDmoUhOIr/oWZWe9QQlvyi5zd3CBlcRGirI2Xu3 xoda9XfGecVbhDqM8sxxLaF7yl5N+EwWMYaRcs23oq4ZtKUyjZ03OfUU8iHfu9BmLfwt brCVwWcgcX0XvHNvRy35F27kxV3SImWKU/VA1oZyJerSCro3yDIWOg2dJFOvSrvhE4gV Khdg== X-Gm-Message-State: AOAM531bY5NpK9BZq8Cz8bSmm3COvKpje5cePw8j+kz7N3RdhpgGorzm HkkCiRgsa5B83oPssiSvJw8K2/+02KU= X-Google-Smtp-Source: ABdhPJzdKbi6hicygN9ix2LKBGVYiLnct7k0Y+70scP68v5w901AQnvBGnjOrfXyzEefgLdG8AFZCA== X-Received: by 2002:a7b:c40b:: with SMTP id k11mr5986841wmi.36.1608167237038; Wed, 16 Dec 2020 17:07:17 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id i9sm5945322wrs.70.2020.12.16.17.07.16 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:16 -0800 (PST) Message-Id: <34309526806256171215daf54b4e283eb3e7e0a7.1608167230.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:05 +0000 Subject: [PATCH 06/11] t5505: finalize transitioning to using the branch name `main` Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started that transition, trying to prepare for a time when `git init` would use that name for the initial branch. Even if that time has not arrived, we can complete the transition by making the test script independent of the default branch name. This also allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from four test cases. Signed-off-by: Johannes Schindelin --- t/t5505-remote.sh | 156 +++++++++++++++++++++++----------------------- 1 file changed, 78 insertions(+), 78 deletions(-) diff --git a/t/t5505-remote.sh b/t/t5505-remote.sh index eaa6e902204..ecadf02d64b 100755 --- a/t/t5505-remote.sh +++ b/t/t5505-remote.sh @@ -7,7 +7,7 @@ test_description='git remote porcelain-ish' setup_repository () { mkdir "$1" && ( cd "$1" && - git init && + git init -b main && >file && git add file && test_tick && @@ -17,7 +17,7 @@ setup_repository () { git add elif && test_tick && git commit -m "Second" && - git checkout master + git checkout main ) } @@ -60,8 +60,8 @@ test_expect_success C_LOCALE_OUTPUT 'remote information for the origin' ' ( cd test && tokens_match origin "$(git remote)" && - check_remote_track origin master side && - check_tracking_branch origin HEAD master side + check_remote_track origin main side && + check_tracking_branch origin HEAD main side ) ' @@ -70,7 +70,7 @@ test_expect_success 'add another remote' ' cd test && git remote add -f second ../two && tokens_match "origin second" "$(git remote)" && - check_tracking_branch second master side another && + check_tracking_branch second main side another && git for-each-ref "--format=%(refname)" refs/remotes | sed -e "/^refs\/remotes\/origin\//d" \ -e "/^refs\/remotes\/second\//d" >actual && @@ -81,8 +81,8 @@ test_expect_success 'add another remote' ' test_expect_success C_LOCALE_OUTPUT 'check remote-tracking' ' ( cd test && - check_remote_track origin master side && - check_remote_track second master side another + check_remote_track origin main side && + check_remote_track second main side another ) ' @@ -99,7 +99,7 @@ test_expect_success 'remote forces tracking branches' ' test_expect_success 'remove remote' ' ( cd test && - git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/master && + git symbolic-ref refs/remotes/second/HEAD refs/remotes/second/main && git remote rm second ) ' @@ -108,7 +108,7 @@ test_expect_success C_LOCALE_OUTPUT 'remove remote' ' ( cd test && tokens_match origin "$(git remote)" && - check_remote_track origin master side && + check_remote_track origin main side && git for-each-ref "--format=%(refname)" refs/remotes | sed -e "/^refs\/remotes\/origin\//d" >actual && test_must_be_empty actual @@ -121,13 +121,13 @@ test_expect_success 'remove remote protects local branches' ' cat >expect1 <<-\EOF && Note: A branch outside the refs/remotes/ hierarchy was not removed; to delete it, use: - git branch -d master + git branch -d main EOF cat >expect2 <<-\EOF && Note: Some branches outside the refs/remotes/ hierarchy were not removed; to delete them, use: git branch -d foobranch - git branch -d master + git branch -d main EOF git tag footag && git config --add remote.oops.fetch "+refs/*:refs/*" && @@ -153,7 +153,7 @@ test_expect_success 'remove errors out early when deleting non-existent branch' test_expect_success 'remove remote with a branch without configured merge' ' test_when_finished "( - git -C test checkout master; + git -C test checkout main; git -C test branch -D two; git -C test config --remove-section remote.two; git -C test config --remove-section branch.second; @@ -163,9 +163,9 @@ test_expect_success 'remove remote with a branch without configured merge' ' cd test && git remote add two ../two && git fetch two && - git checkout -b second two/master^0 && + git checkout -b second two/main^0 && git config branch.second.remote two && - git checkout master && + git checkout main && git remote rm two ) ' @@ -211,7 +211,7 @@ cat >test/expect <test/expect <>file && test_tick && git commit -m update file && - git checkout master && - git branch --track octopus origin/master && - git branch --track rebase origin/master && - git branch -d -r origin/master && + git checkout main && + git branch --track octopus origin/main && + git branch --track rebase origin/main && + git branch -d -r origin/main && git config --add remote.two.url ../two && git config --add remote.two.pushurl ../three && git config branch.rebase.rebase true && @@ -258,10 +258,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'show' ' git commit -m update file ) && git config --add remote.origin.push : && - git config --add remote.origin.push refs/heads/master:refs/heads/upstream && + git config --add remote.origin.push refs/heads/main:refs/heads/upstream && git config --add remote.origin.push +refs/tags/lastbackup && - git config --add remote.two.push +refs/heads/ahead:refs/heads/master && - git config --add remote.two.push refs/heads/master:refs/heads/another && + git config --add remote.two.push +refs/heads/ahead:refs/heads/main && + git config --add remote.two.push refs/heads/main:refs/heads/another && git remote show origin two >output && git branch -d rebase octopus && test_i18ncmp expect output @@ -274,7 +274,7 @@ cat >test/expect <test/expect <expect && + echo refs/remotes/origin/main >expect && git symbolic-ref refs/remotes/origin/HEAD >output && test_cmp expect output ) ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'set-head --auto has no problem w/multiple HEADs' ' +test_expect_success 'set-head --auto has no problem w/multiple HEADs' ' ( cd test && git fetch two "refs/heads/*:refs/remotes/two/*" && git remote set-head --auto two >output 2>&1 && - echo "two/HEAD set to master" >expect && + echo "two/HEAD set to main" >expect && test_i18ncmp expect output ) ' @@ -347,7 +347,7 @@ test_expect_success 'set-head explicit' ' cd test && git remote set-head origin side2 && git symbolic-ref refs/remotes/origin/HEAD >output && - git remote set-head origin master && + git remote set-head origin main && test_cmp expect output ) ' @@ -394,7 +394,7 @@ test_expect_success 'add --mirror && prune' ' test_expect_success 'add --mirror=fetch' ' mkdir mirror-fetch && - git init mirror-fetch/parent && + git init -b main mirror-fetch/parent && ( cd mirror-fetch/parent && test_commit one @@ -410,7 +410,7 @@ test_expect_success 'fetch mirrors act as mirrors during fetch' ' ( cd mirror-fetch/parent && git branch new && - git branch -m master renamed + git branch -m main renamed ) && ( cd mirror-fetch/child && @@ -424,7 +424,7 @@ test_expect_success 'fetch mirrors can prune' ' ( cd mirror-fetch/child && git remote prune parent && - test_must_fail git rev-parse --verify refs/heads/master + test_must_fail git rev-parse --verify refs/heads/main ) ' @@ -465,7 +465,7 @@ test_expect_success 'fetch mirror respects specific branches' ' test_expect_success 'add --mirror=push' ' mkdir mirror-push && git init --bare mirror-push/public && - git init mirror-push/private && + git init -b main mirror-push/private && ( cd mirror-push/private && test_commit one && @@ -477,14 +477,14 @@ test_expect_success 'push mirrors act as mirrors during push' ' ( cd mirror-push/private && git branch new && - git branch -m master renamed && + git branch -m main renamed && git push public ) && ( cd mirror-push/private && git rev-parse --verify refs/heads/new && git rev-parse --verify refs/heads/renamed && - test_must_fail git rev-parse --verify refs/heads/master + test_must_fail git rev-parse --verify refs/heads/main ) ' @@ -610,10 +610,10 @@ test_expect_success 'reject --no-no-tags' ' ' cat >one/expect <<\EOF - apis/master + apis/main apis/side drosophila/another - drosophila/master + drosophila/main drosophila/side EOF @@ -630,11 +630,11 @@ test_expect_success 'update' ' cat >one/expect <<\EOF drosophila/another - drosophila/master + drosophila/main drosophila/side - manduca/master + manduca/main manduca/side - megaloprepus/master + megaloprepus/main megaloprepus/side EOF @@ -673,11 +673,11 @@ test_expect_success 'update --prune' ' ' cat >one/expect <<-\EOF - apis/master + apis/main apis/side - manduca/master + manduca/main manduca/side - megaloprepus/master + megaloprepus/main megaloprepus/side EOF @@ -697,7 +697,7 @@ test_expect_success 'update default' ' cat >one/expect <<\EOF drosophila/another - drosophila/master + drosophila/main drosophila/side EOF @@ -751,14 +751,14 @@ test_expect_success 'rename a remote' ' git clone one four && ( cd four && - git config branch.master.pushRemote origin && + git config branch.main.pushRemote origin && git remote rename origin upstream && test -z "$(git for-each-ref refs/remotes/origin)" && - test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/master" && - test "$(git rev-parse upstream/master)" = "$(git rev-parse master)" && + test "$(git symbolic-ref refs/remotes/upstream/HEAD)" = "refs/remotes/upstream/main" && + test "$(git rev-parse upstream/main)" = "$(git rev-parse main)" && test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/remotes/upstream/*" && - test "$(git config branch.master.remote)" = "upstream" && - test "$(git config branch.master.pushRemote)" = "upstream" && + test "$(git config branch.main.remote)" = "upstream" && + test "$(git config branch.main.pushRemote)" = "upstream" && test "$(git config --global remote.pushDefault)" = "origin" ) ' @@ -804,7 +804,7 @@ test_expect_success 'rename does not update a non-default fetch refspec' ' git config remote.origin.fetch +refs/heads/*:refs/heads/origin/* && git remote rename origin upstream && test "$(git config remote.upstream.fetch)" = "+refs/heads/*:refs/heads/origin/*" && - git rev-parse -q origin/master + git rev-parse -q origin/main ) ' @@ -824,7 +824,7 @@ test_expect_success 'rename a remote with name prefix of other remote' ' cd four.three && git remote add o git://example.com/repo.git && git remote rename o upstream && - test "$(git rev-parse origin/master)" = "$(git rev-parse master)" + test "$(git rev-parse origin/main)" = "$(git rev-parse main)" ) ' @@ -840,11 +840,11 @@ test_expect_success 'remove a remote' ' git clone one four.five && ( cd four.five && - git config branch.master.pushRemote origin && + git config branch.main.pushRemote origin && git remote remove origin && test -z "$(git for-each-ref refs/remotes/origin)" && - test_must_fail git config branch.master.remote && - test_must_fail git config branch.master.pushRemote && + test_must_fail git config branch.main.remote && + test_must_fail git config branch.main.pushRemote && test "$(git config --global remote.pushDefault)" = "origin" ) ' @@ -885,9 +885,9 @@ test_expect_success 'remove a remote removes repo remote.pushDefault but keeps g cat >remotes_origin <push_expected <<-\EOF && - refs/heads/master:refs/heads/upstream + refs/heads/main:refs/heads/upstream refs/heads/next:refs/heads/upstream2 EOF cat >fetch_expected <<-\EOF && - refs/heads/master:refs/heads/origin + refs/heads/main:refs/heads/origin refs/heads/next:refs/heads/origin2 EOF git config --get-all remote.origin.push >push_actual && @@ -923,12 +923,12 @@ test_expect_success 'migrate a remote from named file in $GIT_DIR/branches' ' ( cd six && git remote rm origin && - echo "$origin_url" >.git/branches/origin && + echo "$origin_url#main" >.git/branches/origin && git remote rename origin origin && test_path_is_missing .git/branches/origin && test "$(git config remote.origin.url)" = "$origin_url" && - test "$(git config remote.origin.fetch)" = "refs/heads/master:refs/heads/origin" && - test "$(git config remote.origin.push)" = "HEAD:refs/heads/master" + test "$(git config remote.origin.fetch)" = "refs/heads/main:refs/heads/origin" && + test "$(git config remote.origin.push)" = "HEAD:refs/heads/main" ) ' @@ -951,7 +951,7 @@ test_expect_success 'remote prune to cause a dangling symref' ' ( cd one && git checkout side2 && - git branch -D master + git branch -D main ) && ( cd eight && @@ -994,22 +994,22 @@ test_expect_success 'remote set-branches' ' EOF sort <<-\EOF >expect.replace && +refs/heads/maint:refs/remotes/scratch/maint - +refs/heads/master:refs/remotes/scratch/master + +refs/heads/main:refs/remotes/scratch/main +refs/heads/next:refs/remotes/scratch/next EOF sort <<-\EOF >expect.add-two && +refs/heads/maint:refs/remotes/scratch/maint - +refs/heads/master:refs/remotes/scratch/master + +refs/heads/main:refs/remotes/scratch/main +refs/heads/next:refs/remotes/scratch/next +refs/heads/seen:refs/remotes/scratch/seen +refs/heads/t/topic:refs/remotes/scratch/t/topic EOF sort <<-\EOF >expect.setup-ffonly && - refs/heads/master:refs/remotes/scratch/master + refs/heads/main:refs/remotes/scratch/main +refs/heads/next:refs/remotes/scratch/next EOF sort <<-\EOF >expect.respect-ffonly && - refs/heads/master:refs/remotes/scratch/master + refs/heads/main:refs/remotes/scratch/main +refs/heads/next:refs/remotes/scratch/next +refs/heads/seen:refs/remotes/scratch/seen EOF @@ -1025,7 +1025,7 @@ test_expect_success 'remote set-branches' ' git config --get-all remote.scratch.fetch >config-result && sort ../actual.add && - git remote set-branches scratch maint master next && + git remote set-branches scratch maint main next && git config --get-all remote.scratch.fetch >config-result && sort ../actual.replace && @@ -1035,7 +1035,7 @@ test_expect_success 'remote set-branches' ' git config --unset-all remote.scratch.fetch && git config remote.scratch.fetch \ - refs/heads/master:refs/remotes/scratch/master && + refs/heads/main:refs/remotes/scratch/main && git config --add remote.scratch.fetch \ +refs/heads/next:refs/remotes/scratch/next && git config --get-all remote.scratch.fetch >config-result && @@ -1055,14 +1055,14 @@ test_expect_success 'remote set-branches' ' test_expect_success 'remote set-branches with --mirror' ' echo "+refs/*:refs/*" >expect.initial && - echo "+refs/heads/master:refs/heads/master" >expect.replace && + echo "+refs/heads/main:refs/heads/main" >expect.replace && git clone --mirror .git/ setbranches-mirror && ( cd setbranches-mirror && git remote rename origin scratch && git config --get-all remote.scratch.fetch >../actual.initial && - git remote set-branches scratch heads/master && + git remote set-branches scratch heads/main && git config --get-all remote.scratch.fetch >../actual.replace ) && test_cmp expect.initial actual.initial && @@ -1308,7 +1308,7 @@ test_extra_arg () { test_extra_arg add nick url test_extra_arg rename origin newname test_extra_arg remove origin -test_extra_arg set-head origin master +test_extra_arg set-head origin main # set-branches takes any number of args test_extra_arg get-url origin newurl test_extra_arg set-url origin newurl oldurl @@ -1325,7 +1325,7 @@ test_expect_success 'unqualified refspec DWIM and advice' ' test_when_finished "(cd test && git tag -d some-tag)" && ( cd test && - git tag -a -m "Some tag" some-tag master && + git tag -a -m "Some tag" some-tag main && exit_with=true && for type in commit tag tree blob do @@ -1348,10 +1348,10 @@ test_expect_success 'unqualified refspec DWIM and advice' ' ) ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'refs/remotes/* refspec and unqualified DWIM and advice' ' +test_expect_success 'refs/remotes/* refspec and unqualified DWIM and advice' ' ( cd two && - git tag -a -m "Some tag" my-tag master && + git tag -a -m "Some tag" my-tag main && git update-ref refs/trees/my-head-tree HEAD^{tree} && git update-ref refs/blobs/my-file-blob HEAD:file ) && From patchwork Thu Dec 17 01:07:06 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978865 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0635AC1B0D8 for ; Thu, 17 Dec 2020 01:08:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C94C322D74 for ; Thu, 17 Dec 2020 01:08:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731344AbgLQBIg (ORCPT ); Wed, 16 Dec 2020 20:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54344 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729689AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wr1-x434.google.com (mail-wr1-x434.google.com [IPv6:2a00:1450:4864:20::434]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 97464C061248 for ; Wed, 16 Dec 2020 17:07:19 -0800 (PST) Received: by mail-wr1-x434.google.com with SMTP id d13so6664475wrc.13 for ; Wed, 16 Dec 2020 17:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=x2Fw571SL4L0/p0ylM/z7EvkzH9jaB8fCyWY5KczG4U=; b=P6EzGFdhy+ktas/Zk1fMzgOKak6YnSza4MiVXz94stePpsLE5XpX0umlTn7/shtMNK +AhdPLVwz+bEsjBG7Gx3TL1QPfMcfs2ohq+W0jKMtkCncofWtwWh5WJm5zeHJDsbbxik c1KtYb1bC/An060Nua88Ai6XmKg5xRRhUmurGFz8rC8a/J+2FQ/rptR4jA/5nBlgV4w1 ptbZmJ2HNjfjv0PPRImPDo8lmsvtrYWguG3c+6BlcytE4OFo/MHPl0R0bT/7wzHb2SGc 9O2WHS1XirQIT7uftFMl9BTnJErjPHycrDyvy4176Ya5Mv02Zx79De5j0BOIpkjcTtJ8 Zilg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=x2Fw571SL4L0/p0ylM/z7EvkzH9jaB8fCyWY5KczG4U=; b=h9NEHneGhrbGB+Fxnue3bRqwkuz0RFPlBiRlsb2ucYc/hqfm0RS7615fGthgvdWRyO Lo/FYKStth13lVFGZpW3QMLTAN/QoEUCcOLVPRpKGjrO3f1wVDD2qzlzBYoVRZtfqGxz 6Ep/I+y49eYi4zk2QXW+u4fzGmmZLtdb3gXgujpEFYP7qNa68HLFKhxlkc2TGQgYGUV3 Oo4abZwoX4znJ1Lzowqe7LLaRH44PtD718y9A2qC1TzOZnkz8ThPjsETVLM68FgmE5mM U9UDAmbtjZ48rU/7ExYeBBWfcLVXeXize/+lI3g03iaGVg8ZE1paCi/zlw5s1mFb+ozJ eMMA== X-Gm-Message-State: AOAM532w0vAwEMc1U6BXUWl9/F8nN7Yj/xafy/6iVnG4FcRUkgNMMUrA 9i41xypvpSe5OpUOSHm/48lVUBzda6E= X-Google-Smtp-Source: ABdhPJxvHgZGSawRZKZB593ys/eIsqLw6xqHba762hmzIQbcoqlGwzbaBKA9oWcHLjnGKsSOCEmkXA== X-Received: by 2002:adf:97ce:: with SMTP id t14mr41110619wrb.368.1608167237810; Wed, 16 Dec 2020 17:07:17 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id f77sm4145259wmf.42.2020.12.16.17.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:17 -0800 (PST) Message-Id: <5ad7c105cf97322b2302ef24887926a5e8582929.1608167230.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:06 +0000 Subject: [PATCH 07/11] t5510: use `main` as initial branch name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we prepared this test script for a time when the default initial branch name would be `main`. However, there is no need to wait for that: let's adjust the test script to stop relying on a specific initial branch name by setting it explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from two test cases. Signed-off-by: Johannes Schindelin --- t/t5510-fetch.sh | 168 ++++++++++++++++++++++++----------------------- 1 file changed, 85 insertions(+), 83 deletions(-) diff --git a/t/t5510-fetch.sh b/t/t5510-fetch.sh index 5d673358f9b..2013051a64e 100755 --- a/t/t5510-fetch.sh +++ b/t/t5510-fetch.sh @@ -25,7 +25,9 @@ convert_bundle_to_pack () { test_expect_success setup ' echo >file original && git add file && - git commit -a -m original' + git commit -a -m original && + git branch -M main +' test_expect_success "clone and setup child repos" ' git clone . one && @@ -37,19 +39,19 @@ test_expect_success "clone and setup child repos" ' git clone . two && ( cd two && - git config branch.master.remote one && + git config branch.main.remote one && git config remote.one.url ../one/.git/ && - git config remote.one.fetch refs/heads/master:refs/heads/one + git config remote.one.fetch refs/heads/main:refs/heads/one ) && git clone . three && ( cd three && - git config branch.master.remote two && - git config branch.master.merge refs/heads/one && + git config branch.main.remote two && + git config branch.main.merge refs/heads/one && mkdir -p .git/remotes && { echo "URL: ../two/.git/" - echo "Pull: refs/heads/master:refs/heads/two" + echo "Pull: refs/heads/main:refs/heads/two" echo "Pull: refs/heads/one:refs/heads/one" } >.git/remotes/two ) && @@ -65,7 +67,7 @@ test_expect_success "fetch test" ' git fetch && git rev-parse --verify refs/heads/one && mine=$(git rev-parse refs/heads/one) && - his=$(cd ../one && git rev-parse refs/heads/master) && + his=$(cd ../one && git rev-parse refs/heads/main) && test "z$mine" = "z$his" ' @@ -75,11 +77,11 @@ test_expect_success "fetch test for-merge" ' git fetch && git rev-parse --verify refs/heads/two && git rev-parse --verify refs/heads/one && - master_in_two=$(cd ../two && git rev-parse master) && + main_in_two=$(cd ../two && git rev-parse main) && one_in_two=$(cd ../two && git rev-parse one) && { echo "$one_in_two " - echo "$master_in_two not-for-merge" + echo "$main_in_two not-for-merge" } >expected && cut -f -2 .git/FETCH_HEAD >actual && test_cmp expected actual' @@ -88,7 +90,7 @@ test_expect_success 'fetch --prune on its own works as expected' ' cd "$D" && git clone . prune && cd prune && - git update-ref refs/remotes/origin/extrabranch master && + git update-ref refs/remotes/origin/extrabranch main && git fetch --prune origin && test_must_fail git rev-parse origin/extrabranch @@ -98,9 +100,9 @@ test_expect_success 'fetch --prune with a branch name keeps branches' ' cd "$D" && git clone . prune-branch && cd prune-branch && - git update-ref refs/remotes/origin/extrabranch master && + git update-ref refs/remotes/origin/extrabranch main && - git fetch --prune origin master && + git fetch --prune origin main && git rev-parse origin/extrabranch ' @@ -110,18 +112,18 @@ test_expect_success 'fetch --prune with a namespace keeps other namespaces' ' cd prune-namespace && git fetch --prune origin refs/heads/a/*:refs/remotes/origin/a/* && - git rev-parse origin/master + git rev-parse origin/main ' test_expect_success 'fetch --prune handles overlapping refspecs' ' cd "$D" && - git update-ref refs/pull/42/head master && + git update-ref refs/pull/42/head main && git clone . prune-overlapping && cd prune-overlapping && git config --add remote.origin.fetch refs/pull/*/head:refs/remotes/origin/pr/* && git fetch --prune origin && - git rev-parse origin/master && + git rev-parse origin/main && git rev-parse origin/pr/42 && git config --unset-all remote.origin.fetch && @@ -129,7 +131,7 @@ test_expect_success 'fetch --prune handles overlapping refspecs' ' git config --add remote.origin.fetch refs/heads/*:refs/remotes/origin/* && git fetch --prune origin && - git rev-parse origin/master && + git rev-parse origin/main && git rev-parse origin/pr/42 ' @@ -137,13 +139,13 @@ test_expect_success 'fetch --prune --tags prunes branches but not tags' ' cd "$D" && git clone . prune-tags && cd prune-tags && - git tag sometag master && + git tag sometag main && # Create what looks like a remote-tracking branch from an earlier # fetch that has since been deleted from the remote: - git update-ref refs/remotes/origin/fake-remote master && + git update-ref refs/remotes/origin/fake-remote main && git fetch --prune --tags origin && - git rev-parse origin/master && + git rev-parse origin/main && test_must_fail git rev-parse origin/fake-remote && git rev-parse sometag ' @@ -152,10 +154,10 @@ test_expect_success 'fetch --prune --tags with branch does not prune other thing cd "$D" && git clone . prune-tags-branch && cd prune-tags-branch && - git tag sometag master && - git update-ref refs/remotes/origin/extrabranch master && + git tag sometag main && + git update-ref refs/remotes/origin/extrabranch main && - git fetch --prune --tags origin master && + git fetch --prune --tags origin main && git rev-parse origin/extrabranch && git rev-parse sometag ' @@ -164,9 +166,9 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec' cd "$D" && git clone . prune-tags-refspec && cd prune-tags-refspec && - git tag sometag master && - git update-ref refs/remotes/origin/foo/otherbranch master && - git update-ref refs/remotes/origin/extrabranch master && + git tag sometag main && + git update-ref refs/remotes/origin/foo/otherbranch main && + git update-ref refs/remotes/origin/extrabranch main && git fetch --prune --tags origin refs/heads/foo/*:refs/remotes/origin/foo/* && test_must_fail git rev-parse refs/remotes/origin/foo/otherbranch && @@ -177,20 +179,20 @@ test_expect_success 'fetch --prune --tags with refspec prunes based on refspec' test_expect_success '--refmap="" ignores configured refspec' ' cd "$TRASH_DIRECTORY" && git clone "$D" remote-refs && - git -C remote-refs rev-parse remotes/origin/master >old && - git -C remote-refs update-ref refs/remotes/origin/master master~1 && - git -C remote-refs rev-parse remotes/origin/master >new && + git -C remote-refs rev-parse remotes/origin/main >old && + git -C remote-refs update-ref refs/remotes/origin/main main~1 && + git -C remote-refs rev-parse remotes/origin/main >new && git -C remote-refs fetch --refmap= origin "+refs/heads/*:refs/hidden/origin/*" && - git -C remote-refs rev-parse remotes/origin/master >actual && + git -C remote-refs rev-parse remotes/origin/main >actual && test_cmp new actual && git -C remote-refs fetch origin && - git -C remote-refs rev-parse remotes/origin/master >actual && + git -C remote-refs rev-parse remotes/origin/main >actual && test_cmp old actual ' test_expect_success '--refmap="" and --prune' ' - git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch master && - git -C remote-refs update-ref refs/hidden/foo/otherbranch master && + git -C remote-refs update-ref refs/remotes/origin/foo/otherbranch main && + git -C remote-refs update-ref refs/hidden/foo/otherbranch main && git -C remote-refs fetch --prune --refmap="" origin +refs/heads/*:refs/hidden/* && git -C remote-refs rev-parse remotes/origin/foo/otherbranch && test_must_fail git -C remote-refs rev-parse refs/hidden/foo/otherbranch && @@ -250,7 +252,7 @@ test_expect_success 'fetch uses remote ref names to describe new refs' ' test_i18ngrep "new tag.* -> descriptive-tag$" actual && test_i18ngrep "new ref.* -> crazy$" actual ) && - git checkout master + git checkout main ' test_expect_success 'fetch must not resolve short tag name' ' @@ -281,7 +283,7 @@ test_expect_success 'create bundle 1' ' cd "$D" && echo >file updated again by origin && git commit -a -m "tip" && - git bundle create --version=3 bundle1 master^..master + git bundle create --version=3 bundle1 main^..main ' test_expect_success 'header of bundle looks right' ' @@ -289,7 +291,7 @@ test_expect_success 'header of bundle looks right' ' # v3 git bundle @object-format=$(test_oid algo) -OID updated by origin - OID refs/heads/master + OID refs/heads/main EOF sed -e "s/$OID_REGEX/OID/g" -e "5q" "$D"/bundle1 >actual && @@ -298,13 +300,13 @@ test_expect_success 'header of bundle looks right' ' test_expect_success 'create bundle 2' ' cd "$D" && - git bundle create bundle2 master~2..master + git bundle create bundle2 main~2..main ' test_expect_success 'unbundle 1' ' cd "$D/bundle" && git checkout -b some-branch && - test_must_fail git fetch "$D/bundle1" master:master + test_must_fail git fetch "$D/bundle1" main:main ' @@ -317,8 +319,8 @@ test_expect_success 'bundle 1 has only 3 files ' ' test_expect_success 'unbundle 2' ' cd "$D/bundle" && - git fetch ../bundle2 master:master && - test "tip" = "$(git log -1 --pretty=oneline master | cut -d" " -f2)" + git fetch ../bundle2 main:main && + test "tip" = "$(git log -1 --pretty=oneline main | cut -d" " -f2)" ' test_expect_success 'bundle does not prerequisite objects' ' @@ -335,14 +337,14 @@ test_expect_success 'bundle does not prerequisite objects' ' test_expect_success 'bundle should be able to create a full history' ' cd "$D" && - git tag -a -m "1.0" v1.0 master && + git tag -a -m "1.0" v1.0 main && git bundle create bundle4 v1.0 ' test_expect_success 'fetch with a non-applying branch..merge' ' - git config branch.master.remote yeti && - git config branch.master.merge refs/heads/bigfoot && + git config branch.main.remote yeti && + git config branch.main.merge refs/heads/bigfoot && git config remote.blub.url one && git config remote.blub.fetch "refs/heads/*:refs/remotes/one/*" && git fetch blub @@ -362,8 +364,8 @@ test_expect_success 'fetch from GIT URL with a non-applying branch..merge # the merge spec matches the branch the remote HEAD points to test_expect_success 'fetch from GIT URL with a non-applying branch..merge [2]' ' one_ref=$(cd one && git symbolic-ref HEAD) && - git config branch.master.remote blub && - git config branch.master.merge "$one_ref" && + git config branch.main.remote blub && + git config branch.main.merge "$one_ref" && git update-ref -d FETCH_HEAD && git fetch one && test $one_head = "$(git rev-parse --verify FETCH_HEAD)" && @@ -373,7 +375,7 @@ test_expect_success 'fetch from GIT URL with a non-applying branch..merge # URL supplied to fetch matches the url of the configured branch's remote, but # the merge spec does not match the branch the remote HEAD points to test_expect_success 'fetch from GIT URL with a non-applying branch..merge [3]' ' - git config branch.master.merge "${one_ref}_not" && + git config branch.main.merge "${one_ref}_not" && git update-ref -d FETCH_HEAD && git fetch one && test $one_head = "$(git rev-parse --verify FETCH_HEAD)" && @@ -389,9 +391,9 @@ test_expect_success 'quoting of a strangely named repo' ' test_expect_success 'bundle should record HEAD correctly' ' cd "$D" && - git bundle create bundle5 HEAD master && + git bundle create bundle5 HEAD main && git bundle list-heads bundle5 >actual && - for h in HEAD refs/heads/master + for h in HEAD refs/heads/main do echo "$(git rev-parse --verify $h) $h" done >expect && @@ -399,10 +401,10 @@ test_expect_success 'bundle should record HEAD correctly' ' ' -test_expect_success 'mark initial state of origin/master' ' +test_expect_success 'mark initial state of origin/main' ' ( cd three && - git tag base-origin-master refs/remotes/origin/master + git tag base-origin-main refs/remotes/origin/main ) ' @@ -412,10 +414,10 @@ test_expect_success 'explicit fetch should update tracking' ' git branch -f side && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && - o=$(git rev-parse --verify refs/remotes/origin/master) && - git fetch origin master && - n=$(git rev-parse --verify refs/remotes/origin/master) && + git update-ref refs/remotes/origin/main base-origin-main && + o=$(git rev-parse --verify refs/remotes/origin/main) && + git fetch origin main && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" != "$n" && test_must_fail git rev-parse --verify refs/remotes/origin/side ) @@ -427,10 +429,10 @@ test_expect_success 'explicit pull should update tracking' ' git branch -f side && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && - o=$(git rev-parse --verify refs/remotes/origin/master) && - git pull origin master && - n=$(git rev-parse --verify refs/remotes/origin/master) && + git update-ref refs/remotes/origin/main base-origin-main && + o=$(git rev-parse --verify refs/remotes/origin/main) && + git pull origin main && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" != "$n" && test_must_fail git rev-parse --verify refs/remotes/origin/side ) @@ -449,13 +451,13 @@ test_expect_success 'explicit --refmap option overrides remote.*.fetch' ' git branch -f side && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && - o=$(git rev-parse --verify refs/remotes/origin/master) && - git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin master && - n=$(git rev-parse --verify refs/remotes/origin/master) && + git update-ref refs/remotes/origin/main base-origin-main && + o=$(git rev-parse --verify refs/remotes/origin/main) && + git fetch --refmap="refs/heads/*:refs/remotes/other/*" origin main && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" = "$n" && test_must_fail git rev-parse --verify refs/remotes/origin/side && - git rev-parse --verify refs/remotes/other/master + git rev-parse --verify refs/remotes/other/main ) ' @@ -464,10 +466,10 @@ test_expect_success 'explicitly empty --refmap option disables remote.*.fetch' ' git branch -f side && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && - o=$(git rev-parse --verify refs/remotes/origin/master) && - git fetch --refmap="" origin master && - n=$(git rev-parse --verify refs/remotes/origin/master) && + git update-ref refs/remotes/origin/main base-origin-main && + o=$(git rev-parse --verify refs/remotes/origin/main) && + git fetch --refmap="" origin main && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" = "$n" && test_must_fail git rev-parse --verify refs/remotes/origin/side ) @@ -479,10 +481,10 @@ test_expect_success 'configured fetch updates tracking' ' git branch -f side && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && - o=$(git rev-parse --verify refs/remotes/origin/master) && + git update-ref refs/remotes/origin/main base-origin-main && + o=$(git rev-parse --verify refs/remotes/origin/main) && git fetch origin && - n=$(git rev-parse --verify refs/remotes/origin/master) && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" != "$n" && git rev-parse --verify refs/remotes/origin/side ) @@ -493,12 +495,12 @@ test_expect_success 'non-matching refspecs do not confuse tracking update' ' git update-ref refs/odd/location HEAD && ( cd three && - git update-ref refs/remotes/origin/master base-origin-master && + git update-ref refs/remotes/origin/main base-origin-main && git config --add remote.origin.fetch \ refs/odd/location:refs/remotes/origin/odd && - o=$(git rev-parse --verify refs/remotes/origin/master) && - git fetch origin master && - n=$(git rev-parse --verify refs/remotes/origin/master) && + o=$(git rev-parse --verify refs/remotes/origin/main) && + git fetch origin main && + n=$(git rev-parse --verify refs/remotes/origin/main) && test "$o" != "$n" && test_must_fail git rev-parse --verify refs/remotes/origin/odd ) @@ -524,7 +526,7 @@ test_expect_success 'auto tag following fetches minimum' ' git tag -a -m $i excess-$i || exit 1 done ) && - git checkout master && + git checkout main && ( cd follow && git fetch @@ -533,13 +535,13 @@ test_expect_success 'auto tag following fetches minimum' ' test_expect_success 'refuse to fetch into the current branch' ' - test_must_fail git fetch . side:master + test_must_fail git fetch . side:main ' test_expect_success 'fetch into the current branch with --update-head-ok' ' - git fetch --update-head-ok . side:master + git fetch --update-head-ok . side:main ' @@ -568,7 +570,7 @@ test_expect_success "should be able to fetch with duplicate refspecs" ' ( cd dups && git init && - git config branch.master.remote three && + git config branch.main.remote three && git config remote.three.url ../three/.git && git config remote.three.fetch +refs/heads/*:refs/remotes/origin/* && git config --add remote.three.fetch +refs/heads/*:refs/remotes/origin/* && @@ -877,11 +879,11 @@ test_expect_success 'all boundary commits are excluded' ' test_commit oneside && git checkout HEAD^ && test_commit otherside && - git checkout master && + git checkout main && test_tick && git merge otherside && ad=$(git log --no-walk --format=%ad HEAD) && - git bundle create twoside-boundary.bdl master --since="$ad" && + git bundle create twoside-boundary.bdl main --since="$ad" && convert_bundle_to_pack twoside-boundary.pack && pack=$(git index-pack --fix-thin --stdin X-Patchwork-Id: 11978861 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 298F1C4361B for ; Thu, 17 Dec 2020 01:08:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 011E322D74 for ; Thu, 17 Dec 2020 01:08:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731359AbgLQBIg (ORCPT ); Wed, 16 Dec 2020 20:08:36 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54346 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730661AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wm1-x32e.google.com (mail-wm1-x32e.google.com [IPv6:2a00:1450:4864:20::32e]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B65AC061257 for ; Wed, 16 Dec 2020 17:07:20 -0800 (PST) Received: by mail-wm1-x32e.google.com with SMTP id g25so2933363wmh.1 for ; Wed, 16 Dec 2020 17:07:19 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=V7iEskZRu2XLZHFLJ5MWpIVX13qVIZzHMOlNM/+qDew=; b=VnoyuAObF5jRVlVsth7AdjAhnFhhKMB2mqEBvb0GLnnM18dq3J/id/BmmguHW94JeT l+E4ZDMvIBOHSUeflGMcyXsl1sMOiqF080MdUyqN0R151JgRuaR6txSUB9Az9OSAopOM 6sAbEuiBwfRzAJ95nf/dwhYfMQ1n8b32hPl8nUPAC+MZPWxRdKqwsasKuQP7GFZ4UTga xBw00rn2zC7C5QrSVIq9ORYrRAEgPP6QlFz8WwLiaZXbzMvVC1C/jsBUogNcgCgKKwNB fqPI7QMyr3PH8Ryjmha9KYe2nLuRJUsjfYip7o17bOaiSuzSWvqwWA3Um4VrCvg9ufx3 3GCw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=V7iEskZRu2XLZHFLJ5MWpIVX13qVIZzHMOlNM/+qDew=; b=aZyT8CfUYplnslTOtoevrdROG2w4jOjaRi0L8Lo1tM8r0XhaZ3NiOT4sd6po9CAVVV 7UFAI3GmHta7Zt53lbmr+Fcad45A9Sb6iI3EHPjS8aWOibwqhVnlXzYd+dXdCiz1oIeE Dj7irzqqvuXY6N3xKrWU6E2U9idv+LeoIvsEBopg08/H2JMwEXtsVLBvoPCPuRMA4a7s Ig+Q2jgxzedW+lHm1eAsyxZrxG21NF5Nb948g9UunGnUNmKpcz+FaZ1KD98LvPwCzHTQ dD4iqeUVjHOc01VkIKTp28xG1KQiGGqKS+0GYX2xrarE2gpx+dgi3SnXcsf769bGUdwy VROQ== X-Gm-Message-State: AOAM532/kpS1Ernmq186noyuUxG3JIsLqpFHsCQlgws8OuqjyWiHP9Sz flIsXt1oMqt4HNC/YYPE6bldghhWrCw= X-Google-Smtp-Source: ABdhPJxLjk4jcNr17fJ0xMBQDGj9uvssC0a8EshNvWamF6knEbKfHLUHOl7aAi/QF8FvUkubEKacRg== X-Received: by 2002:a1c:6856:: with SMTP id d83mr6055037wmc.119.1608167238529; Wed, 16 Dec 2020 17:07:18 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id k10sm5203068wrq.38.2020.12.16.17.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:18 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:07 +0000 Subject: [PATCH 08/11] t5703: use `main` as initial branch name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 97cf8d50b59 (t5703: adjust a test case for the upcoming default branch name, 2020-10-23), we prepared this test script for a world when the default initial branch name would be `main`. However, there is no need to wait for that: let's adjust the test script to stop relying on a specific initial branch name by setting it explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test case. Signed-off-by: Johannes Schindelin --- t/t5703-upload-pack-ref-in-want.sh | 65 +++++++++++++++--------------- 1 file changed, 33 insertions(+), 32 deletions(-) diff --git a/t/t5703-upload-pack-ref-in-want.sh b/t/t5703-upload-pack-ref-in-want.sh index b46940b725b..eab966985b7 100755 --- a/t/t5703-upload-pack-ref-in-want.sh +++ b/t/t5703-upload-pack-ref-in-want.sh @@ -38,12 +38,13 @@ write_command () { # c(o/foo) d(o/bar) # \ / -# b e(baz) f(master) +# b e(baz) f(main) # \__ | __/ # \ | / # a test_expect_success 'setup repository' ' test_commit a && + git branch -M main && git checkout -b o/foo && test_commit b && test_commit c && @@ -51,7 +52,7 @@ test_expect_success 'setup repository' ' test_commit d && git checkout -b baz a && test_commit e && - git checkout master && + git checkout main && test_commit f ' @@ -88,7 +89,7 @@ test_expect_success 'invalid want-ref line' ' test_expect_success 'basic want-ref' ' oid=$(git rev-parse f) && cat >expected_refs <<-EOF && - $oid refs/heads/master + $oid refs/heads/main EOF git rev-parse f >expected_commits && @@ -97,7 +98,7 @@ test_expect_success 'basic want-ref' ' $(write_command fetch) 0001 no-progress - want-ref refs/heads/master + want-ref refs/heads/main have $oid done 0000 @@ -135,7 +136,7 @@ test_expect_success 'multiple want-ref lines' ' test_expect_success 'mix want and want-ref' ' oid=$(git rev-parse f) && cat >expected_refs <<-EOF && - $oid refs/heads/master + $oid refs/heads/main EOF git rev-parse e f >expected_commits && @@ -143,7 +144,7 @@ test_expect_success 'mix want and want-ref' ' $(write_command fetch) 0001 no-progress - want-ref refs/heads/master + want-ref refs/heads/main want $(git rev-parse e) have $(git rev-parse a) done @@ -182,7 +183,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine" # $REPO # c(o/foo) d(o/bar) # \ / -# b e(baz) f(master) +# b e(baz) f(main) # \__ | __/ # \ | / # a @@ -193,10 +194,10 @@ LOCAL_PRISTINE="$(pwd)/local_pristine" # . # . # | -# a(master) +# a(main) test_expect_success 'setup repos for fetching with ref-in-want tests' ' ( - git init "$REPO" && + git init -b main "$REPO" && cd "$REPO" && test_commit a && @@ -209,7 +210,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' ' test_commit_bulk --id=s 33 && # Add novel commits to upstream - git checkout master && + git checkout main && cd "$REPO" && git checkout -b o/foo && test_commit b && @@ -218,7 +219,7 @@ test_expect_success 'setup repos for fetching with ref-in-want tests' ' test_commit d && git checkout -b baz a && test_commit e && - git checkout master && + git checkout main && test_commit f ) && git -C "$REPO" config uploadpack.allowRefInWant true && @@ -245,12 +246,12 @@ test_expect_success 'fetching multiple refs' ' rm -rf local && cp -r "$LOCAL_PRISTINE" local && - GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin master baz && + GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin main baz && - git -C "$REPO" rev-parse "master" "baz" >expected && - git -C local rev-parse refs/remotes/origin/master refs/remotes/origin/baz >actual && + git -C "$REPO" rev-parse "main" "baz" >expected && + git -C local rev-parse refs/remotes/origin/main refs/remotes/origin/baz >actual && test_cmp expected actual && - grep "want-ref refs/heads/master" log && + grep "want-ref refs/heads/main" log && grep "want-ref refs/heads/baz" log ' @@ -261,13 +262,13 @@ test_expect_success 'fetching ref and exact OID' ' cp -r "$LOCAL_PRISTINE" local && oid=$(git -C "$REPO" rev-parse b) && GIT_TRACE_PACKET="$(pwd)/log" git -C local fetch origin \ - master "$oid":refs/heads/actual && + main "$oid":refs/heads/actual && - git -C "$REPO" rev-parse "master" "b" >expected && - git -C local rev-parse refs/remotes/origin/master refs/heads/actual >actual && + git -C "$REPO" rev-parse "main" "b" >expected && + git -C local rev-parse refs/remotes/origin/main refs/heads/actual >actual && test_cmp expected actual && grep "want $oid" log && - grep "want-ref refs/heads/master" log + grep "want-ref refs/heads/main" log ' test_expect_success 'fetching with wildcard that does not match any refs' ' @@ -301,7 +302,7 @@ LOCAL_PRISTINE="$(pwd)/local_pristine" test_expect_success 'setup repos for change-while-negotiating test' ' ( - git init "$REPO" && + git init -b main "$REPO" && cd "$REPO" && >.git/git-daemon-export-ok && test_commit m1 && @@ -316,7 +317,7 @@ test_expect_success 'setup repos for change-while-negotiating test' ' test_commit_bulk --id=s 33 && # Add novel commits to upstream - git checkout master && + git checkout main && cd "$REPO" && test_commit m2 && test_commit m3 && @@ -342,7 +343,7 @@ test_expect_success 'server is initially ahead - no ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant false && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master $(test_oid numeric) && + inconsistency main $(test_oid numeric) && test_must_fail git -C local fetch 2>err && test_i18ngrep "fatal: remote error: upload-pack: not our ref" err ' @@ -351,11 +352,11 @@ test_expect_success 'server is initially ahead - ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant true && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master $(test_oid numeric) && + inconsistency main $(test_oid numeric) && git -C local fetch && - git -C "$REPO" rev-parse --verify master >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && + git -C "$REPO" rev-parse --verify main >expected && + git -C local rev-parse --verify refs/remotes/origin/main >actual && test_cmp expected actual ' @@ -363,11 +364,11 @@ test_expect_success 'server is initially behind - no ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant false && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master "master^" && + inconsistency main "main^" && git -C local fetch && - git -C "$REPO" rev-parse --verify "master^" >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && + git -C "$REPO" rev-parse --verify "main^" >expected && + git -C local rev-parse --verify refs/remotes/origin/main >actual && test_cmp expected actual ' @@ -375,15 +376,15 @@ test_expect_success 'server is initially behind - ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant true && rm -rf local && cp -r "$LOCAL_PRISTINE" local && - inconsistency master "master^" && + inconsistency main "main^" && git -C local fetch && - git -C "$REPO" rev-parse --verify "master" >expected && - git -C local rev-parse --verify refs/remotes/origin/master >actual && + git -C "$REPO" rev-parse --verify "main" >expected && + git -C local rev-parse --verify refs/remotes/origin/main >actual && test_cmp expected actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'server loses a ref - ref in want' ' +test_expect_success 'server loses a ref - ref in want' ' git -C "$REPO" config uploadpack.allowRefInWant true && rm -rf local && cp -r "$LOCAL_PRISTINE" local && From patchwork Thu Dec 17 01:07:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978857 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D05FAC2BBCA for ; Thu, 17 Dec 2020 01:08:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A0A4322D74 for ; Thu, 17 Dec 2020 01:08:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732009AbgLQBIi (ORCPT ); Wed, 16 Dec 2020 20:08:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54348 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731327AbgLQBIf (ORCPT ); Wed, 16 Dec 2020 20:08:35 -0500 Received: from mail-wr1-x42b.google.com (mail-wr1-x42b.google.com [IPv6:2a00:1450:4864:20::42b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D8261C0611C5 for ; Wed, 16 Dec 2020 17:07:20 -0800 (PST) Received: by mail-wr1-x42b.google.com with SMTP id t16so24912607wra.3 for ; Wed, 16 Dec 2020 17:07:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=Dw8457Xlfc/LyDER7Al275oh3wmJpBK9ZNA6HHjSEa0=; b=pwXvdH3hLW6sMlLJqTCZnChm1Awxjfln7+G12HL4l/sykS74sSG3+O2gVDtcVoKeYj HWdK3ii9TovJ0TJdjR3/O7TvRCVIlK8oe4Yt8/69GqTCqaIDtiFLG/VLJNl25scclqX0 nAtDjIe8tm3dBjHCmexEogotX3z1/1Ivdq+pni91a5wqRuVmQdWTVFXEV0Rhn/PkY74z e1T/ZbOR1EmWcwf0ot8lQpLle/bOz4gYXohIbpPPI84i8+xctOecMnKyYgLx/K2j3tpl NjJAhL4nsTeSoJSV/eDREmu+DyCWCYsvv0SjrmBOCjqS+1FjS+aI0PRc64wft3iX9XRt B9bg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=Dw8457Xlfc/LyDER7Al275oh3wmJpBK9ZNA6HHjSEa0=; b=jrZtLfy9RGwW5GYQXHgNzYHGHZ3KYjSOElQdoer1BpJAJUvcyht+5plsdSIMikIQLU beKrDJy2JhOIKgC6VI+3n16qu+kLRWEL85onMW9ZS4Y3/eCuIywufGnyW0Nkd1j/2Fhq k9kQLzQX2ZuWRVWtagFetAuVnIi8oqJOBZzJxrYQB32jTMoL6ig7tFFaRJ0lMi7t9tnb 9gW/a2DB2PmKoDhdF69tQc0cEHkJsn0eeGHEau7NyBnZJNFkQhhRV2oqvm/7wjNWuP8U GGICXBsYtaPKox5pGXq9SMMRT2/A/OH882ewBrpP5nHq0RP6lEogzu2lpwYcrbhPvd51 wIQw== X-Gm-Message-State: AOAM531stU+frMLdHV01vrzrDdOqZzF5w/fDnCqb+k1iUMmUqFOSmlao 5tueE9Y+mH+vGsDBPw8UoxZZaDl0CFU= X-Google-Smtp-Source: ABdhPJy1UjXC7GpkyIzBHzy6+ZkLP9sZZbXy8nUivZ9TXXaRM5+rOlW9mesmluAbSqmQ8HD30GJY/Q== X-Received: by 2002:adf:a29d:: with SMTP id s29mr40386108wra.272.1608167239399; Wed, 16 Dec 2020 17:07:19 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id e16sm5896414wra.94.2020.12.16.17.07.18 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:18 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:08 +0000 Subject: [PATCH 09/11] t6302: use `main` as initial branch name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 66713e84e71 (tests: prepare aligned mentions of the default branch name, 2020-10-23), we started adjusting this test script for the default initial branch name changing to `main`. However, there is no need to wait for that: let's adjust the test script to stop relying on a specific initial branch name by setting it explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from six test cases. Signed-off-by: Johannes Schindelin --- t/t6302-for-each-ref-filter.sh | 59 +++++++++++++++++----------------- 1 file changed, 30 insertions(+), 29 deletions(-) diff --git a/t/t6302-for-each-ref-filter.sh b/t/t6302-for-each-ref-filter.sh index 0a21669f56d..9b8c8b2842f 100755 --- a/t/t6302-for-each-ref-filter.sh +++ b/t/t6302-for-each-ref-filter.sh @@ -7,6 +7,7 @@ test_description='test for-each-refs usage of ref-filter APIs' test_expect_success 'setup some history and refs' ' test_commit one && + git branch -M main && test_commit two && test_commit three && git checkout -b side && @@ -26,17 +27,17 @@ test_expect_success 'setup some history and refs' ' git tag $sign -m "A signed tag" signed-tag && git tag $sign -m "Signed doubly" doubly-signed-tag signed-tag && - git checkout master && - git update-ref refs/odd/spot master + git checkout main && + git update-ref refs/odd/spot main ' test_expect_success 'filtering with --points-at' ' cat >expect <<-\EOF && - refs/heads/master + refs/heads/main refs/odd/spot refs/tags/three EOF - git for-each-ref --format="%(refname)" --points-at=master >actual && + git for-each-ref --format="%(refname)" --points-at=main >actual && test_cmp expect actual ' @@ -53,13 +54,13 @@ test_expect_success 'check signed tags with --points-at' ' test_expect_success 'filtering with --merged' ' cat >expect <<-\EOF && - refs/heads/master + refs/heads/main refs/odd/spot refs/tags/one refs/tags/three refs/tags/two EOF - git for-each-ref --format="%(refname)" --merged=master >actual && + git for-each-ref --format="%(refname)" --merged=main >actual && test_cmp expect actual ' @@ -72,13 +73,13 @@ test_expect_success 'filtering with --no-merged' ' refs/tags/four refs/tags/signed-tag EOF - git for-each-ref --format="%(refname)" --no-merged=master >actual && + git for-each-ref --format="%(refname)" --no-merged=main >actual && test_cmp expect actual ' test_expect_success 'filtering with --contains' ' cat >expect <<-\EOF && - refs/heads/master + refs/heads/main refs/heads/side refs/odd/spot refs/tags/annotated-tag @@ -113,7 +114,7 @@ test_expect_success '%(color) must fail' ' test_must_fail git for-each-ref --format="%(color)%(refname)" ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' ' +test_expect_success 'left alignment is default' ' cat >expect <<-\EOF && refname is refs/heads/main |refs/heads/main refname is refs/heads/side |refs/heads/side @@ -131,7 +132,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'left alignment is default' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' ' +test_expect_success 'middle alignment' ' cat >expect <<-\EOF && | refname is refs/heads/main |refs/heads/main | refname is refs/heads/side |refs/heads/side @@ -149,7 +150,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'middle alignment' ' test_cmp expect actual ' -test_expect_success PREPARE_FOR_MAIN_BRANCH 'right alignment' ' +test_expect_success 'right alignment' ' cat >expect <<-\EOF && | refname is refs/heads/main|refs/heads/main | refname is refs/heads/side|refs/heads/side @@ -184,7 +185,7 @@ EOF test_align_permutations() { while read -r option do - test_expect_success PREPARE_FOR_MAIN_BRANCH "align:$option" ' + test_expect_success "align:$option" ' git for-each-ref --format="|%(align:$option)refname is %(refname)%(end)|%(refname)" >actual && test_cmp expect actual ' @@ -213,7 +214,7 @@ EOF # Individual atoms inside %(align:...) and %(end) must not be quoted. -test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' " +test_expect_success 'alignment with format quote' " cat >expect <<-\EOF && |' '\''main| A U Thor'\'' '| |' '\''side| A U Thor'\'' '| @@ -231,7 +232,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'alignment with format quote' " test_cmp expect actual " -test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatting' " +test_expect_success 'nested alignment with quote formatting' " cat >expect <<-\EOF && |' main '| |' side '| @@ -251,7 +252,7 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH 'nested alignment with quote formatt test_expect_success 'check `%(contents:lines=1)`' ' cat >expect <<-\EOF && - master |three + main |three side |four odd/spot |three annotated-tag |An annotated tag @@ -269,7 +270,7 @@ test_expect_success 'check `%(contents:lines=1)`' ' test_expect_success 'check `%(contents:lines=0)`' ' cat >expect <<-\EOF && - master | + main | side | odd/spot | annotated-tag | @@ -287,7 +288,7 @@ test_expect_success 'check `%(contents:lines=0)`' ' test_expect_success 'check `%(contents:lines=99999)`' ' cat >expect <<-\EOF && - master |three + main |three side |four odd/spot |three annotated-tag |An annotated tag @@ -360,7 +361,7 @@ test_expect_success 'improper usage of %(if), %(then), %(else) and %(end) atoms' test_expect_success 'check %(if)...%(then)...%(end) atoms' ' git for-each-ref --format="%(refname)%(if)%(authorname)%(then) Author: %(authorname)%(end)" >actual && cat >expect <<-\EOF && - refs/heads/master Author: A U Thor + refs/heads/main Author: A U Thor refs/heads/side Author: A U Thor refs/odd/spot Author: A U Thor refs/tags/annotated-tag @@ -381,7 +382,7 @@ test_expect_success 'check %(if)...%(then)...%(end) atoms' ' test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' ' git for-each-ref --format="%(if)%(authorname)%(then)%(authorname)%(else)No author%(end): %(refname)" >actual && cat >expect <<-\EOF && - A U Thor: refs/heads/master + A U Thor: refs/heads/main A U Thor: refs/heads/side A U Thor: refs/odd/spot No author: refs/tags/annotated-tag @@ -401,7 +402,7 @@ test_expect_success 'check %(if)...%(then)...%(else)...%(end) atoms' ' test_expect_success 'ignore spaces in %(if) atom usage' ' git for-each-ref --format="%(refname:short): %(if)%(HEAD)%(then)Head ref%(else)Not Head ref%(end)" >actual && cat >expect <<-\EOF && - master: Head ref + main: Head ref side: Not Head ref odd/spot: Not Head ref annotated-tag: Not Head ref @@ -420,19 +421,19 @@ test_expect_success 'ignore spaces in %(if) atom usage' ' ' test_expect_success 'check %(if:equals=)' ' - git for-each-ref --format="%(if:equals=master)%(refname:short)%(then)Found master%(else)Not master%(end)" refs/heads/ >actual && + git for-each-ref --format="%(if:equals=main)%(refname:short)%(then)Found main%(else)Not main%(end)" refs/heads/ >actual && cat >expect <<-\EOF && - Found master - Not master + Found main + Not main EOF test_cmp expect actual ' test_expect_success 'check %(if:notequals=)' ' - git for-each-ref --format="%(if:notequals=master)%(refname:short)%(then)Not master%(else)Found master%(end)" refs/heads/ >actual && + git for-each-ref --format="%(if:notequals=main)%(refname:short)%(then)Not main%(else)Found main%(end)" refs/heads/ >actual && cat >expect <<-\EOF && - Found master - Not master + Found main + Not main EOF test_cmp expect actual ' @@ -443,11 +444,11 @@ test_expect_success '--merged is compatible with --no-merged' ' test_expect_success 'validate worktree atom' ' cat >expect <<-EOF && - master: $(pwd) - master_worktree: $(pwd)/worktree_dir + main: $(pwd) + main_worktree: $(pwd)/worktree_dir side: not checked out EOF - git worktree add -b master_worktree worktree_dir master && + git worktree add -b main_worktree worktree_dir main && git for-each-ref --format="%(refname:short): %(if)%(worktreepath)%(then)%(worktreepath)%(else)not checked out%(end)" refs/heads/ >actual && rm -r worktree_dir && git worktree prune && From patchwork Thu Dec 17 01:07:09 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978863 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 1BC8FC0018C for ; Thu, 17 Dec 2020 01:08:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id DCC1722D74 for ; Thu, 17 Dec 2020 01:08:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733013AbgLQBIm (ORCPT ); Wed, 16 Dec 2020 20:08:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54354 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731346AbgLQBIg (ORCPT ); Wed, 16 Dec 2020 20:08:36 -0500 Received: from mail-wm1-x335.google.com (mail-wm1-x335.google.com [IPv6:2a00:1450:4864:20::335]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 34CBAC0611CA for ; Wed, 16 Dec 2020 17:07:22 -0800 (PST) Received: by mail-wm1-x335.google.com with SMTP id c133so4005678wme.4 for ; Wed, 16 Dec 2020 17:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=MeH4rM/i67JHhIGyTsFD//oSSG/Lbc59NaptuEiqD9U=; b=YQOsUXK6eRUsLjnr5+wxAqnumsYCyZmj1x5wEK+VmnoiGGnrjTXRQIKgwBc5QCtYrJ bI833nd0GoIQquQH7v1KFpT3C5oLKUqdSVFVETieNbEEsvZA3fwi7l4VYSFfQgSVMzLG mhhmDUUfFQ1MhmnXlhOTK8hvYcxoRvpgDMd0tw0H8b3hyhHA+a4PI0X6lMhgyEtJIuvM PSc7s3j7fnQirl6rSTZN5s8FQB+i/WX2Xjoni0PChjHVWA23pCE7EKHabD3a7aDi1o7g w+DMi73qV1dKLNoBxf1szwEjrTJcWx1xRkbYLZQtmQ7nRVZFQrPzdHgbLis9eDRVBA+s oc9g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=MeH4rM/i67JHhIGyTsFD//oSSG/Lbc59NaptuEiqD9U=; b=JJ+Iso2kVh0z0j3uQV9mOBvnUQ30OQ1tv1U6rVE189WlI4K8s20n1kV4q+RY5v8hm8 ezEfqUJX/l8QbA+nLMOwjyFgG5FMBIZU1ltbkuxa9g1f/1h6U7GKIsEX46VrobrF3WMe fRI2AGSOoFwbL8x55vt+eanWt7Gs4AjX6fXSCu3tC9rkrlGopqkQs2cAMluN4y8HP4/m 8IfApA/hA3DG5sFISMYzCyu86etYY8NUIWW6xoOgdj73+9eboo42VWJlFgXZ8YZmmRSh 9pjkMDIYO+2FPC7DN1K9IeJdiGs8h1HmQ9vVUPH/Hvcqp8QVtQLP00zFXICZAtY/YGES fWEQ== X-Gm-Message-State: AOAM53220q1Czla1kCuK0KLO85joqwLwJApofnWy/s6qRgyZyarQaNtF Kx4/HjQGyz9huIBlcv/tPZkyd6hKTn8= X-Google-Smtp-Source: ABdhPJwLO/6DyjfUKpLUw/i47aEasBY926cSSDf7PXiBa5bR1gGQpULvRv3Lw8KgH7/KbwHqMPtmuw== X-Received: by 2002:a1c:8016:: with SMTP id b22mr5876917wmd.135.1608167240231; Wed, 16 Dec 2020 17:07:20 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id h29sm5859663wrc.68.2020.12.16.17.07.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:19 -0800 (PST) Message-Id: In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:09 +0000 Subject: [PATCH 10/11] t9902: use `main` as initial branch name Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin In 8164360fc86 (t9902: prepare a test for the upcoming default branch name, 2020-10-23), we started adjusting this test script for the default initial branch name changing to `main`. However, there is no need to wait for that: let's adjust the test script to stop relying on a specific initial branch name by setting it explicitly. This allows us to drop the `PREPARE_FOR_MAIN_BRANCH` prereq from one test case. Signed-off-by: Johannes Schindelin --- t/t9902-completion.sh | 309 +++++++++++++++++++++--------------------- 1 file changed, 155 insertions(+), 154 deletions(-) diff --git a/t/t9902-completion.sh b/t/t9902-completion.sh index 81a728c7433..a1c4f1f6d40 100755 --- a/t/t9902-completion.sh +++ b/t/t9902-completion.sh @@ -136,7 +136,7 @@ fi test_expect_success 'setup for __git_find_repo_path/__gitdir tests' ' mkdir -p subdir/subsubdir && mkdir -p non-repo && - git init otherrepo + git init -b main otherrepo ' test_expect_success '__git_find_repo_path - from command line (through $__git_dir)' ' @@ -614,12 +614,13 @@ test_expect_success '__git_is_configured_remote' ' test_expect_success 'setup for ref completion' ' git commit --allow-empty -m initial && + git branch -M main && git branch matching-branch && git tag matching-tag && ( cd otherrepo && git commit --allow-empty -m initial && - git branch -m master master-in-other && + git branch -m main main-in-other && git branch branch-in-other && git tag tag-in-other ) && @@ -632,10 +633,10 @@ test_expect_success 'setup for ref completion' ' test_expect_success '__git_refs - simple' ' cat >expected <<-EOF && HEAD - master + main matching-branch other/branch-in-other - other/master-in-other + other/main-in-other matching-tag EOF ( @@ -647,10 +648,10 @@ test_expect_success '__git_refs - simple' ' test_expect_success '__git_refs - full refs' ' cat >expected <<-EOF && - refs/heads/master + refs/heads/main refs/heads/matching-branch refs/remotes/other/branch-in-other - refs/remotes/other/master-in-other + refs/remotes/other/main-in-other refs/tags/matching-tag EOF ( @@ -664,7 +665,7 @@ test_expect_success '__git_refs - repo given on the command line' ' cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other tag-in-other EOF ( @@ -679,7 +680,7 @@ test_expect_success '__git_refs - remote on local file system' ' cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other tag-in-other EOF ( @@ -692,7 +693,7 @@ test_expect_success '__git_refs - remote on local file system' ' test_expect_success '__git_refs - remote on local file system - full refs' ' cat >expected <<-EOF && refs/heads/branch-in-other - refs/heads/master-in-other + refs/heads/main-in-other refs/tags/tag-in-other EOF ( @@ -706,7 +707,7 @@ test_expect_success '__git_refs - configured remote' ' cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other EOF ( cur= && @@ -719,7 +720,7 @@ test_expect_success '__git_refs - configured remote - full refs' ' cat >expected <<-EOF && HEAD refs/heads/branch-in-other - refs/heads/master-in-other + refs/heads/main-in-other refs/tags/tag-in-other EOF ( @@ -733,7 +734,7 @@ test_expect_success '__git_refs - configured remote - repo given on the command cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other EOF ( cd thirdrepo && @@ -748,7 +749,7 @@ test_expect_success '__git_refs - configured remote - full refs - repo given on cat >expected <<-EOF && HEAD refs/heads/branch-in-other - refs/heads/master-in-other + refs/heads/main-in-other refs/tags/tag-in-other EOF ( @@ -764,7 +765,7 @@ test_expect_success '__git_refs - configured remote - remote name matches a dire cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other EOF mkdir other && test_when_finished "rm -rf other" && @@ -779,7 +780,7 @@ test_expect_success '__git_refs - URL remote' ' cat >expected <<-EOF && HEAD branch-in-other - master-in-other + main-in-other tag-in-other EOF ( @@ -793,7 +794,7 @@ test_expect_success '__git_refs - URL remote - full refs' ' cat >expected <<-EOF && HEAD refs/heads/branch-in-other - refs/heads/master-in-other + refs/heads/main-in-other refs/tags/tag-in-other EOF ( @@ -849,23 +850,23 @@ test_expect_success '__git_refs - not in a git repository' ' test_expect_success '__git_refs - unique remote branches for git checkout DWIMery' ' cat >expected <<-EOF && HEAD - master + main matching-branch other/ambiguous other/branch-in-other - other/master-in-other + other/main-in-other remote/ambiguous remote/branch-in-remote matching-tag branch-in-other branch-in-remote - master-in-other + main-in-other EOF for remote_ref in refs/remotes/other/ambiguous \ refs/remotes/remote/ambiguous \ refs/remotes/remote/branch-in-remote do - git update-ref $remote_ref master && + git update-ref $remote_ref main && test_when_finished "git update-ref -d $remote_ref" done && ( @@ -878,10 +879,10 @@ test_expect_success '__git_refs - unique remote branches for git checkout DWIMer test_expect_success '__git_refs - after --opt=' ' cat >expected <<-EOF && HEAD - master + main matching-branch other/branch-in-other - other/master-in-other + other/main-in-other matching-tag EOF ( @@ -893,10 +894,10 @@ test_expect_success '__git_refs - after --opt=' ' test_expect_success '__git_refs - after --opt= - full refs' ' cat >expected <<-EOF && - refs/heads/master + refs/heads/main refs/heads/matching-branch refs/remotes/other/branch-in-other - refs/remotes/other/master-in-other + refs/remotes/other/main-in-other refs/tags/matching-tag EOF ( @@ -909,10 +910,10 @@ test_expect_success '__git_refs - after --opt= - full refs' ' test_expect_success '__git refs - excluding refs' ' cat >expected <<-EOF && ^HEAD - ^master + ^main ^matching-branch ^other/branch-in-other - ^other/master-in-other + ^other/main-in-other ^matching-tag EOF ( @@ -924,10 +925,10 @@ test_expect_success '__git refs - excluding refs' ' test_expect_success '__git refs - excluding full refs' ' cat >expected <<-EOF && - ^refs/heads/master + ^refs/heads/main ^refs/heads/matching-branch ^refs/remotes/other/branch-in-other - ^refs/remotes/other/master-in-other + ^refs/remotes/other/main-in-other ^refs/tags/matching-tag EOF ( @@ -948,17 +949,17 @@ test_expect_success 'setup for filtering matching refs' ' test_expect_success '__git_refs - do not filter refs unless told so' ' cat >expected <<-EOF && HEAD - master + main matching-branch matching/branch other/branch-in-other - other/master-in-other + other/main-in-other other/matching/branch-in-other matching-tag matching/tag EOF ( - cur=master && + cur=main && __git_refs >"$actual" ) && test_cmp expected "$actual" @@ -992,7 +993,7 @@ test_expect_success '__git_refs - only matching refs - full refs' ' test_expect_success '__git_refs - only matching refs - remote on local file system' ' cat >expected <<-EOF && - master-in-other + main-in-other matching/branch-in-other EOF ( @@ -1004,7 +1005,7 @@ test_expect_success '__git_refs - only matching refs - remote on local file syst test_expect_success '__git_refs - only matching refs - configured remote' ' cat >expected <<-EOF && - master-in-other + main-in-other matching/branch-in-other EOF ( @@ -1016,7 +1017,7 @@ test_expect_success '__git_refs - only matching refs - configured remote' ' test_expect_success '__git_refs - only matching refs - remote - full refs' ' cat >expected <<-EOF && - refs/heads/master-in-other + refs/heads/main-in-other refs/heads/matching/branch-in-other EOF ( @@ -1038,7 +1039,7 @@ test_expect_success '__git_refs - only matching refs - checkout DWIMery' ' refs/remotes/remote/ambiguous \ refs/remotes/remote/branch-in-remote do - git update-ref $remote_ref master && + git update-ref $remote_ref main && test_when_finished "git update-ref -d $remote_ref" done && ( @@ -1055,9 +1056,9 @@ test_expect_success 'teardown after filtering matching refs' ' git -C otherrepo branch -D matching/branch-in-other ' -test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format specifiers in prefix' ' +test_expect_success '__git_refs - for-each-ref format specifiers in prefix' ' cat >expected <<-EOF && - evil-%%-%42-%(refname)..master + evil-%%-%42-%(refname)..main EOF ( cur="evil-%%-%42-%(refname)..mai" && @@ -1069,10 +1070,10 @@ test_expect_success PREPARE_FOR_MAIN_BRANCH '__git_refs - for-each-ref format sp test_expect_success '__git_complete_refs - simple' ' sed -e "s/Z$//" >expected <<-EOF && HEAD Z - master Z + main Z matching-branch Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z matching-tag Z EOF ( @@ -1100,7 +1101,7 @@ test_expect_success '__git_complete_refs - remote' ' sed -e "s/Z$//" >expected <<-EOF && HEAD Z branch-in-other Z - master-in-other Z + main-in-other Z EOF ( cur= && @@ -1113,13 +1114,13 @@ test_expect_success '__git_complete_refs - remote' ' test_expect_success '__git_complete_refs - track' ' sed -e "s/Z$//" >expected <<-EOF && HEAD Z - master Z + main Z matching-branch Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z matching-tag Z branch-in-other Z - master-in-other Z + main-in-other Z EOF ( cur= && @@ -1158,10 +1159,10 @@ test_expect_success '__git_complete_refs - prefix' ' test_expect_success '__git_complete_refs - suffix' ' cat >expected <<-EOF && HEAD. - master. + main. matching-branch. other/branch-in-other. - other/master-in-other. + other/main-in-other. matching-tag. EOF ( @@ -1176,7 +1177,7 @@ test_expect_success '__git_complete_fetch_refspecs - simple' ' sed -e "s/Z$//" >expected <<-EOF && HEAD:HEAD Z branch-in-other:branch-in-other Z - master-in-other:master-in-other Z + main-in-other:main-in-other Z EOF ( cur= && @@ -1202,7 +1203,7 @@ test_expect_success '__git_complete_fetch_refspecs - prefix' ' sed -e "s/Z$//" >expected <<-EOF && +HEAD:HEAD Z +branch-in-other:branch-in-other Z - +master-in-other:master-in-other Z + +main-in-other:main-in-other Z EOF ( cur="+" && @@ -1215,7 +1216,7 @@ test_expect_success '__git_complete_fetch_refspecs - prefix' ' test_expect_success '__git_complete_fetch_refspecs - fully qualified' ' sed -e "s/Z$//" >expected <<-EOF && refs/heads/branch-in-other:refs/heads/branch-in-other Z - refs/heads/master-in-other:refs/heads/master-in-other Z + refs/heads/main-in-other:refs/heads/main-in-other Z refs/tags/tag-in-other:refs/tags/tag-in-other Z EOF ( @@ -1229,7 +1230,7 @@ test_expect_success '__git_complete_fetch_refspecs - fully qualified' ' test_expect_success '__git_complete_fetch_refspecs - fully qualified & prefix' ' sed -e "s/Z$//" >expected <<-EOF && +refs/heads/branch-in-other:refs/heads/branch-in-other Z - +refs/heads/master-in-other:refs/heads/master-in-other Z + +refs/heads/main-in-other:refs/heads/main-in-other Z +refs/tags/tag-in-other:refs/tags/tag-in-other Z EOF ( @@ -1243,8 +1244,8 @@ test_expect_success '__git_complete_fetch_refspecs - fully qualified & prefix' ' test_expect_success 'git switch - with no options, complete local branches and unique remote branch names for DWIM logic' ' test_completion "git switch " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' @@ -1253,25 +1254,25 @@ test_expect_success 'git checkout - completes refs and unique remote branches fo test_completion "git checkout " <<-\EOF HEAD Z branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with --no-guess, complete only local branches' ' test_completion "git switch --no-guess " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git switch - with GIT_COMPLETION_CHECKOUT_NO_GUESS=1, complete only local branches' ' GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git switch " <<-\EOF - master Z + main Z matching-branch Z EOF ' @@ -1279,8 +1280,8 @@ test_expect_success 'git switch - with GIT_COMPLETION_CHECKOUT_NO_GUESS=1, compl test_expect_success 'git switch - --guess overrides GIT_COMPLETION_CHECKOUT_NO_GUESS=1, complete local branches and unique remote names for DWIM logic' ' GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git switch --guess " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' @@ -1288,15 +1289,15 @@ test_expect_success 'git switch - --guess overrides GIT_COMPLETION_CHECKOUT_NO_G test_expect_success 'git switch - a later --guess overrides previous --no-guess, complete local and remote unique branches for DWIM' ' test_completion "git switch --no-guess --guess " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' test_expect_success 'git switch - a later --no-guess overrides previous --guess, complete only local branches' ' test_completion "git switch --guess --no-guess " <<-\EOF - master Z + main Z matching-branch Z EOF ' @@ -1304,11 +1305,11 @@ test_expect_success 'git switch - a later --no-guess overrides previous --guess, test_expect_success 'git checkout - with GIT_COMPLETION_NO_GUESS=1 only completes refs' ' GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git checkout " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1316,23 +1317,23 @@ test_expect_success 'git checkout - --guess overrides GIT_COMPLETION_NO_GUESS=1, GIT_COMPLETION_CHECKOUT_NO_GUESS=1 test_completion "git checkout --guess " <<-\EOF HEAD Z branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with --no-guess, only completes refs' ' test_completion "git checkout --no-guess " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1340,23 +1341,23 @@ test_expect_success 'git checkout - a later --guess overrides previous --no-gues test_completion "git checkout --no-guess --guess " <<-\EOF HEAD Z branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - a later --no-guess overrides previous --guess, complete only refs' ' test_completion "git checkout --guess --no-guess " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1364,11 +1365,11 @@ test_expect_success 'git checkout - with checkout.guess = false, only completes test_config checkout.guess false && test_completion "git checkout " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1377,12 +1378,12 @@ test_expect_success 'git checkout - with checkout.guess = true, completes refs a test_completion "git checkout " <<-\EOF HEAD Z branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1391,12 +1392,12 @@ test_expect_success 'git checkout - a later --guess overrides previous checkout. test_completion "git checkout --guess " <<-\EOF HEAD Z branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -1404,75 +1405,75 @@ test_expect_success 'git checkout - a later --no-guess overrides previous checko test_config checkout.guess true && test_completion "git checkout --no-guess " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with --detach, complete all references' ' test_completion "git switch --detach " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with --detach, complete only references' ' test_completion "git checkout --detach " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -d, complete all references' ' test_completion "git switch -d " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -d, complete only references' ' test_completion "git checkout -d " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with --track, complete only remote branches' ' test_completion "git switch --track " <<-\EOF other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with --track, complete only remote branches' ' test_completion "git checkout --track " <<-\EOF other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with --no-track, complete only local branch names' ' test_completion "git switch --no-track " <<-\EOF - master Z + main Z matching-branch Z EOF ' @@ -1480,151 +1481,151 @@ test_expect_success 'git switch - with --no-track, complete only local branch na test_expect_success 'git checkout - with --no-track, complete only local references' ' test_completion "git checkout --no-track " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -c, complete all references' ' test_completion "git switch -c new-branch " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -C, complete all references' ' test_completion "git switch -C new-branch " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -c and --track, complete all references' ' test_completion "git switch -c new-branch --track " <<-EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -C and --track, complete all references' ' test_completion "git switch -C new-branch --track " <<-EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -c and --no-track, complete all references' ' test_completion "git switch -c new-branch --no-track " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - with -C and --no-track, complete all references' ' test_completion "git switch -C new-branch --no-track " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -b, complete all references' ' test_completion "git checkout -b new-branch " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -B, complete all references' ' test_completion "git checkout -B new-branch " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -b and --track, complete all references' ' test_completion "git checkout -b new-branch --track " <<-EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -B and --track, complete all references' ' test_completion "git checkout -B new-branch --track " <<-EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -b and --no-track, complete all references' ' test_completion "git checkout -b new-branch --no-track " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git checkout - with -B and --no-track, complete all references' ' test_completion "git checkout -B new-branch --no-track " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' test_expect_success 'git switch - for -c, complete local branches and unique remote branches' ' test_completion "git switch -c " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' @@ -1632,36 +1633,36 @@ test_expect_success 'git switch - for -c, complete local branches and unique rem test_expect_success 'git switch - for -C, complete local branches and unique remote branches' ' test_completion "git switch -C " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' test_expect_success 'git switch - for -c with --no-guess, complete local branches only' ' test_completion "git switch --no-guess -c " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git switch - for -C with --no-guess, complete local branches only' ' test_completion "git switch --no-guess -C " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git switch - for -c with --no-track, complete local branches only' ' test_completion "git switch --no-track -c " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git switch - for -C with --no-track, complete local branches only' ' test_completion "git switch --no-track -C " <<-\EOF - master Z + main Z matching-branch Z EOF ' @@ -1669,8 +1670,8 @@ test_expect_success 'git switch - for -C with --no-track, complete local branche test_expect_success 'git checkout - for -b, complete local branches and unique remote branches' ' test_completion "git checkout -b " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' @@ -1678,36 +1679,36 @@ test_expect_success 'git checkout - for -b, complete local branches and unique r test_expect_success 'git checkout - for -B, complete local branches and unique remote branches' ' test_completion "git checkout -B " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' test_expect_success 'git checkout - for -b with --no-guess, complete local branches only' ' test_completion "git checkout --no-guess -b " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git checkout - for -B with --no-guess, complete local branches only' ' test_completion "git checkout --no-guess -B " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git checkout - for -b with --no-track, complete local branches only' ' test_completion "git checkout --no-track -b " <<-\EOF - master Z + main Z matching-branch Z EOF ' test_expect_success 'git checkout - for -B with --no-track, complete local branches only' ' test_completion "git checkout --no-track -B " <<-\EOF - master Z + main Z matching-branch Z EOF ' @@ -1715,14 +1716,14 @@ test_expect_success 'git checkout - for -B with --no-track, complete local branc test_expect_success 'git switch - with --orphan completes local branch names and unique remote branch names' ' test_completion "git switch --orphan " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' test_expect_success 'git switch - --orphan with branch already provided completes nothing else' ' - test_completion "git switch --orphan master " <<-\EOF + test_completion "git switch --orphan main " <<-\EOF EOF ' @@ -1730,20 +1731,20 @@ test_expect_success 'git switch - --orphan with branch already provided complete test_expect_success 'git checkout - with --orphan completes local branch names and unique remote branch names' ' test_completion "git checkout --orphan " <<-\EOF branch-in-other Z - master Z - master-in-other Z + main Z + main-in-other Z matching-branch Z EOF ' test_expect_success 'git checkout - --orphan with branch already provided completes local refs for a start-point' ' - test_completion "git checkout --orphan master " <<-\EOF + test_completion "git checkout --orphan main " <<-\EOF HEAD Z - master Z + main Z matching-branch Z matching-tag Z other/branch-in-other Z - other/master-in-other Z + other/main-in-other Z EOF ' @@ -2067,7 +2068,7 @@ test_expect_success 'setup for integration tests' ' test_expect_success 'checkout completes ref names' ' test_completion "git checkout m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2081,7 +2082,7 @@ test_expect_success 'git -C checkout uses the right repo' ' test_expect_success 'show completes all refs' ' test_completion "git show m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2118,7 +2119,7 @@ test_expect_success PERL 'send-email' ' --cover-from-description=Z --cover-letter Z EOF - test_completion "git send-email ma" "master " + test_completion "git send-email ma" "main " ' test_expect_success 'complete files' ' @@ -2198,7 +2199,7 @@ test_expect_success 'complete files' ' test_expect_success "simple alias" ' test_config alias.co checkout && test_completion "git co m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2208,7 +2209,7 @@ test_expect_success "recursive alias" ' test_config alias.co checkout && test_config alias.cod "co --detached" && test_completion "git cod m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2217,7 +2218,7 @@ test_expect_success "recursive alias" ' test_expect_success "completion uses completion for alias: !sh -c 'git ...'" ' test_config alias.co "!sh -c '"'"'git checkout ...'"'"'" && test_completion "git co m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2226,7 +2227,7 @@ test_expect_success "completion uses completion for alias: !sh -c 'git completion for alias: !f () { VAR=val git ... }' ' test_config alias.co "!f () { VAR=val git checkout ... ; } f" && test_completion "git co m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2235,7 +2236,7 @@ test_expect_success 'completion uses completion for alias: !f () { VAR=val test_expect_success 'completion used completion for alias: !f() { : git ; ... }' ' test_config alias.co "!f() { : git checkout ; if ... } f" && test_completion "git co m" <<-\EOF - master Z + main Z mybranch Z mytag Z EOF @@ -2266,7 +2267,7 @@ for flag in -d --delete do test_expect_success "__git_complete_remote_or_refspec - push $flag other" ' sed -e "s/Z$//" >expected <<-EOF && - master-in-other Z + main-in-other Z EOF ( words=(git push '$flag' other ma) && @@ -2279,7 +2280,7 @@ do test_expect_failure "__git_complete_remote_or_refspec - push other $flag" ' sed -e "s/Z$//" >expected <<-EOF && - master-in-other Z + main-in-other Z EOF ( words=(git push other '$flag' ma) && From patchwork Thu Dec 17 01:07:10 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Johannes Schindelin X-Patchwork-Id: 11978855 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A49A6C2BB9A for ; Thu, 17 Dec 2020 01:08:39 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 80BE822D74 for ; Thu, 17 Dec 2020 01:08:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732809AbgLQBIi (ORCPT ); Wed, 16 Dec 2020 20:08:38 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54356 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731351AbgLQBIg (ORCPT ); Wed, 16 Dec 2020 20:08:36 -0500 Received: from mail-wm1-x330.google.com (mail-wm1-x330.google.com [IPv6:2a00:1450:4864:20::330]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E59FC0611CB for ; Wed, 16 Dec 2020 17:07:22 -0800 (PST) Received: by mail-wm1-x330.google.com with SMTP id k10so4019612wmi.3 for ; Wed, 16 Dec 2020 17:07:22 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=message-id:in-reply-to:references:from:date:subject:fcc :content-transfer-encoding:mime-version:to:cc; bh=yVF+gyGriYlGq54eBRzupiWJuPknTUR9Y993OwwQ4Rg=; b=iQcPaeirSkZBVgAH+afVFx1Au1uIBKyxbbgpE9vWlV02lMwObq6gcIeLR83ZCXin00 sXT2jHazr7vmnEvgR/HDmvTK+jb3uaZcpyesUsVQB8Vbqd/AXjp9Wxl4zepn0K60xDPT UjhBtDWJs7+ez8iPj3tAZq5HZ29CEOPrqsny4wA5jMWm60itj81FFhp0+tJa//s7aj3H XzsMAtioQj+zpSTB3KweTwTTEjOKXkI7HSzvKRyozq1EUe4FpAnObz8/A+DcaRnTH6mZ dSbMpd2rqwe3D/8ujbwF3vKzpFxOTuOGyJsMlEs7Wnk7dEaTAGnAVp3klmwQ37+Py84o R4qQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:message-id:in-reply-to:references:from:date :subject:fcc:content-transfer-encoding:mime-version:to:cc; bh=yVF+gyGriYlGq54eBRzupiWJuPknTUR9Y993OwwQ4Rg=; b=Xgehm8HkLrDEgKOqwnrQvCU4kUHt/vMy6uh78tnWVYR7izS8QBcP9O9ibomypQu9iR HjnG4C7VInJqsaE4FNTubqn6aW3PaOJSSnWuy56KDOkOP9pn7p3ds3rwvvhm48CRwLut 3lA2u44JJmRRSQ1hUOio2lFPIcmU2EI6GU0cJH8gKE8vrO/H3yA6aQhpj1MXHg2FSanh T3AbsQH0DagU+JCdgzQq1ro/5eKdgVHAS9RKayat/BZjlbYZ+8JakYWiL/PbhZds1H+w zRmPaZmVPaf0VgP+p8cX/MKKkWHFQeuKrwCLyFQaQxmT2I3wU5ySmEprjpxDgd0TLFtv kZjw== X-Gm-Message-State: AOAM530L/XP47HxqUAU9jrqJ9LVgwMfgwlH/HeoVr4DbwCsX26AlyDX9 AXuiEy1rmHvRTn7ICBsTWNcMM2VbR5A= X-Google-Smtp-Source: ABdhPJxZ3irR+ky4u+HRQs4KAV9WRJXAvBgduGvQoD5PneOJHa1wBndSc1FJSQT2sj177Y002LT/MQ== X-Received: by 2002:a1c:3b44:: with SMTP id i65mr5990676wma.9.1608167241010; Wed, 16 Dec 2020 17:07:21 -0800 (PST) Received: from [127.0.0.1] ([13.74.141.28]) by smtp.gmail.com with ESMTPSA id z64sm5165449wme.10.2020.12.16.17.07.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 16 Dec 2020 17:07:20 -0800 (PST) Message-Id: <3dc48ce96867005b55f44e41e9baab7f0750ab98.1608167230.git.gitgitgadget@gmail.com> In-Reply-To: References: Date: Thu, 17 Dec 2020 01:07:10 +0000 Subject: [PATCH 11/11] tests: drop the `PREPARE_FOR_MAIN_BRANCH` prereq Fcc: Sent MIME-Version: 1.0 To: git@vger.kernel.org Cc: Johannes Schindelin , Johannes Schindelin Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org From: Johannes Schindelin From: Johannes Schindelin We no longer use it. Signed-off-by: Johannes Schindelin --- t/test-lib.sh | 8 -------- 1 file changed, 8 deletions(-) diff --git a/t/test-lib.sh b/t/test-lib.sh index a863ccee7e9..9fa7c1d0f6d 100644 --- a/t/test-lib.sh +++ b/t/test-lib.sh @@ -1712,14 +1712,6 @@ test_lazy_prereq REBASE_P ' test -z "$GIT_TEST_SKIP_REBASE_P" ' -# Special-purpose prereq for transitioning to a new default branch name: -# Some tests need more than just a mindless (case-preserving) s/master/main/g -# replacement. The non-trivial adjustments are guarded behind this -# prerequisite, acting kind of as a feature flag -test_lazy_prereq PREPARE_FOR_MAIN_BRANCH ' - test "$GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME" = main -' - # Ensure that no test accidentally triggers a Git command # that runs 'crontab', affecting a user's cron schedule. # Tests that verify the cron integration must set this locally