Hi Stollee
On 07/06/2019 02:19, Derrick Stolee wrote:
Here is today's test coverage report.
Thanks,
-Stolee
[1] https://derrickstolee.github.io/git-test-coverage/reports/2019-06-06.htm
[2] https://derrickstolee.github.io/git-test-coverage/reports/2019-06-06.txt
---
pu 4f91bbec8a3cc2fff435fb3dbb0dfa5f9d223141
jch e1895a3c3b1fef6d1bc80251d09598e219d3908d
next ee3066bb6536c68f973b3c0ffaaa13f4bfda5ea3
master 74583d89127e21255c12dd3c8a3bf60b497d7d03
master@{1} aa25c82427ae70aebf3b8f970f2afd54e9a2a8c6
Uncovered code in 'pu' not in 'jch'
--------------------------------------------------------
[snip]
Uncovered code in 'jch' not in 'next'
--------------------------------------------------------
builtin/branch.c
1fde99cf 841) die(_("The -a, and -r, options to 'git branch' do not take a branch name.\n"
[nip]
Commits introducting uncovered code:
...
Philip Oakley 1fde99cf doc branch: provide examples for listing remote tracking branches
[snip rest]
The change was just a change to the die() message, but was not tested
previously.
I've guessed that t3203 would be the right place for an extra test which
I've hacked (but not yet tested) as
---
phili@Philip-Win10 MINGW64 /usr/src/git (branch-patterns-v2)
$ git show -1
commit d5a799d8833b0ae195915eefd5365f3fc4c7c0a4 (HEAD ->
branch-patterns-v2, my/branch-patterns-v2)
Author: Philip Oakley <philipoakley@xxxxxxx>
Date: Sat Jun 8 22:50:06 2019 +0100
t3203-branch-output: test -a & -r pattern options
Users may wrongly use the -r and -a options with a branch pattern when
looking for a remote tracking branch. Test that we fail for that
misuse.
Signed-off-by: Philip Oakley <philipoakley@xxxxxxx>
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index ee6787614c..e78bd1c56d 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -264,4 +264,9 @@ test_expect_success '--color overrides auto-color' '
test_cmp expect.color actual
'
+test_expect_success '-a & -r options do not take a branch name, without
--list' '
+ test_must_fail git branch -a HEAD
+ test_must_fail git branch -r HEAD
+'
+
test_done
---
https://github.com/PhilipOakley/git/commit/d5a799d8833b0ae195915eefd5365f3fc4c7c0a4
Not sure if that's the right way to do it (Its my first proper try at
tests themselves..)
I'm going to be away for about a week with only intermittent internet
hence the unfinished reply.
--
Philip