summaryrefslogtreecommitdiff
path: root/t/t3203-branch-output.sh
diff options
context:
space:
mode:
authorZheNing Hu <adlternative@gmail.com>2021-07-26 03:26:50 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-07-26 19:01:26 (GMT)
commitb9dee075eb07713a49922f7e1f90a6a9de5c5e5f (patch)
tree989e44066bf80856880edf37ea3dbcca3a65e2f1 /t/t3203-branch-output.sh
parente85fcb355a38b5f01493efecdf0150a10ee471da (diff)
downloadgit-b9dee075eb07713a49922f7e1f90a6a9de5c5e5f.zip
git-b9dee075eb07713a49922f7e1f90a6a9de5c5e5f.tar.gz
git-b9dee075eb07713a49922f7e1f90a6a9de5c5e5f.tar.bz2
ref-filter: add %(rest) atom
%(rest) is a atom used for cat-file batch mode, which can split the input lines at the first whitespace boundary, all characters before that whitespace are considered to be the object name; characters after that first run of whitespace (i.e., the "rest" of the line) are output in place of the %(rest) atom. In order to let "cat-file --batch=%(rest)" use the ref-filter interface, add %(rest) atom for ref-filter. Introduce the reject_atom() to reject the atom %(rest) for "git for-each-ref", "git branch", "git tag" and "git verify-tag". Reviewed-by: Jacob Keller <jacob.keller@gmail.com> Suggected-by: Jacob Keller <jacob.keller@gmail.com> Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Hariom Verma <hariom18599@gmail.com> Signed-off-by: ZheNing Hu <adlternative@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t3203-branch-output.sh')
-rwxr-xr-xt/t3203-branch-output.sh4
1 files changed, 4 insertions, 0 deletions
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index 5325b9f..6e94c6d 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -340,6 +340,10 @@ test_expect_success 'git branch --format option' '
test_cmp expect actual
'
+test_expect_success 'git branch with --format=%(rest) must fail' '
+ test_must_fail git branch --format="%(rest)" >actual
+'
+
test_expect_success 'worktree colors correct' '
cat >expect <<-EOF &&
* <GREEN>(HEAD detached from fromtag)<RESET>