diff options
| author | Isoken June Ibizugbe <isokenjune@gmail.com> | 2023-10-23 17:06:56 +0100 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2023-10-23 12:22:57 -0700 |
| commit | 12b99928c8fc85a2500f34ef4f492b427b13f088 (patch) | |
| tree | 497990ff1f4a080288c16ab233a39a4d1b8dbb50 /t | |
| parent | The twentieth batch (diff) | |
| download | git-12b99928c8fc85a2500f34ef4f492b427b13f088.tar.gz git-12b99928c8fc85a2500f34ef4f492b427b13f088.zip | |
builtin/branch.c: adjust error messages to coding guidelines
As per the CodingGuidelines document, it is recommended that error messages
such as die(), error() and warning(), should start with a lowercase letter
and should not end with a period.
This patch adjusts tests to match updated messages.
Signed-off-by: Isoken June Ibizugbe <isokenjune@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
| -rwxr-xr-x | t/t2407-worktree-heads.sh | 2 | ||||
| -rwxr-xr-x | t/t3200-branch.sh | 16 | ||||
| -rwxr-xr-x | t/t3202-show-branch.sh | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/t/t2407-worktree-heads.sh b/t/t2407-worktree-heads.sh index 469443d8ae..f6835c91dc 100755 --- a/t/t2407-worktree-heads.sh +++ b/t/t2407-worktree-heads.sh @@ -45,7 +45,7 @@ test_expect_success 'refuse to overwrite: checked out in worktree' ' grep "cannot force update the branch" err && test_must_fail git branch -D wt-$i 2>err && - grep "Cannot delete branch" err || return 1 + grep "cannot delete branch" err || return 1 done ' diff --git a/t/t3200-branch.sh b/t/t3200-branch.sh index 080e4f24a6..3182abde27 100755 --- a/t/t3200-branch.sh +++ b/t/t3200-branch.sh @@ -291,10 +291,10 @@ test_expect_success 'git branch -M topic topic should work when main is checked test_expect_success 'git branch -M and -C fail on detached HEAD' ' git checkout HEAD^{} && test_when_finished git checkout - && - echo "fatal: cannot rename the current branch while not on any." >expect && + echo "fatal: cannot rename the current branch while not on any" >expect && test_must_fail git branch -M must-fail 2>err && test_cmp expect err && - echo "fatal: cannot copy the current branch while not on any." >expect && + echo "fatal: cannot copy the current branch while not on any" >expect && test_must_fail git branch -C must-fail 2>err && test_cmp expect err ' @@ -943,7 +943,7 @@ test_expect_success 'deleting currently checked out branch fails' ' git worktree add -b my7 my7 && test_must_fail git -C my7 branch -d my7 && test_must_fail git branch -d my7 2>actual && - grep "^error: Cannot delete branch .my7. used by worktree at " actual && + grep "^error: cannot delete branch .my7. used by worktree at " actual && rm -r my7 && git worktree prune ' @@ -954,7 +954,7 @@ test_expect_success 'deleting in-use branch fails' ' git -C my7 bisect start HEAD HEAD~2 && test_must_fail git -C my7 branch -d my7 && test_must_fail git branch -d my7 2>actual && - grep "^error: Cannot delete branch .my7. used by worktree at " actual && + grep "^error: cannot delete branch .my7. used by worktree at " actual && rm -r my7 && git worktree prune ' @@ -1024,7 +1024,7 @@ test_expect_success '--set-upstream-to fails on multiple branches' ' 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 main when it does not point to any branch." >expect && + 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_cmp expect err ' @@ -1072,7 +1072,7 @@ test_expect_success 'use --set-upstream-to modify a particular branch' ' ' test_expect_success '--unset-upstream should fail if given a non-existent branch' ' - echo "fatal: Branch '"'"'i-dont-exist'"'"' has no upstream information" >expect && + echo "fatal: branch '"'"'i-dont-exist'"'"' has no upstream information" >expect && test_must_fail git branch --unset-upstream i-dont-exist 2>err && test_cmp expect err ' @@ -1094,7 +1094,7 @@ test_expect_success 'test --unset-upstream on HEAD' ' 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 '"'"'main'"'"' has no upstream information" >expect && + echo "fatal: branch '"'"'main'"'"' has no upstream information" >expect && test_must_fail git branch --unset-upstream 2>err && test_cmp expect err ' @@ -1108,7 +1108,7 @@ test_expect_success '--unset-upstream should fail on multiple branches' ' test_expect_success '--unset-upstream should fail on detached HEAD' ' git checkout HEAD^{} && test_when_finished git checkout - && - echo "fatal: could not unset upstream of HEAD when it does not point to any branch." >expect && + echo "fatal: could not unset upstream of HEAD when it does not point to any branch" >expect && test_must_fail git branch --unset-upstream 2>err && test_cmp expect err ' diff --git a/t/t3202-show-branch.sh b/t/t3202-show-branch.sh index b17f388f56..2cdb834b37 100755 --- a/t/t3202-show-branch.sh +++ b/t/t3202-show-branch.sh @@ -10,7 +10,7 @@ GIT_TEST_DATE_NOW=1251660000; export GIT_TEST_DATE_NOW test_expect_success 'error descriptions on empty repository' ' current=$(git branch --show-current) && cat >expect <<-EOF && - error: No commit on branch '\''$current'\'' yet. + error: no commit on branch '\''$current'\'' yet EOF test_must_fail git branch --edit-description 2>actual && test_cmp expect actual && @@ -21,7 +21,7 @@ test_expect_success 'error descriptions on empty repository' ' test_expect_success 'fatal descriptions on empty repository' ' current=$(git branch --show-current) && cat >expect <<-EOF && - fatal: No commit on branch '\''$current'\'' yet. + fatal: no commit on branch '\''$current'\'' yet EOF test_must_fail git branch --set-upstream-to=non-existent 2>actual && test_cmp expect actual && @@ -224,7 +224,7 @@ done test_expect_success 'error descriptions on non-existent branch' ' cat >expect <<-EOF && - error: No branch named '\''non-existent'\'.' + error: no branch named '\''non-existent'\'' EOF test_must_fail git branch --edit-description non-existent 2>actual && test_cmp expect actual @@ -238,7 +238,7 @@ test_expect_success 'fatal descriptions on non-existent branch' ' test_cmp expect actual && cat >expect <<-EOF && - fatal: No branch named '\''non-existent'\''. + fatal: no branch named '\''non-existent'\'' EOF test_must_fail git branch -c non-existent new-branch 2>actual && test_cmp expect actual && @@ -253,7 +253,7 @@ test_expect_success 'error descriptions on orphan branch' ' test_branch_op_in_wt() { test_orphan_error() { test_must_fail git $* 2>actual && - test_i18ngrep "No commit on branch .orphan-branch. yet.$" actual + test_i18ngrep "no commit on branch .orphan-branch. yet$" actual } && test_orphan_error -C wt branch $1 $2 && # implicit branch test_orphan_error -C wt branch $1 orphan-branch $2 && # explicit branch |
