summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorKarthik Nayak <karthik.188@gmail.com>2015-10-02 23:09:06 +0530
committerJunio C Hamano <gitster@pobox.com>2015-10-02 13:40:15 -0700
commit4c0ca23e71d92a45fb209172aff1c2907b9203cb (patch)
tree13681a864006177be9880f1ce78e5a02ad34ac33 /t
parent22bd48b562a7228a492671a89848882378fe5ce8 (diff)
downloadgit-4c0ca23e71d92a45fb209172aff1c2907b9203cb.tar.gz
branch: implement '--format' optionkn/for-each-branch-remainder
Implement the '--format' option provided by 'ref-filter'. This lets the user list tags as per desired format similar to the implementation in 'git for-each-ref'. Add tests and documentation for the same. Mentored-by: Christian Couder <christian.couder@gmail.com> Mentored-by: Matthieu Moy <matthieu.moy@grenoble-inp.fr> Signed-off-by: Karthik Nayak <karthik.188@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3203-branch-output.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t3203-branch-output.sh b/t/t3203-branch-output.sh
index f1ae5ff662..a475ff1b9a 100755
--- a/t/t3203-branch-output.sh
+++ b/t/t3203-branch-output.sh
@@ -163,4 +163,15 @@ test_expect_success 'git branch --points-at option' '
test_cmp expect actual
'
+test_expect_success 'git branch --format option' '
+ cat >expect <<-\EOF &&
+ Refname is (HEAD detached from fromtag)
+ Refname is refs/heads/branch-one
+ Refname is refs/heads/branch-two
+ Refname is refs/heads/master
+ EOF
+ git branch --format="Refname is %(refname)" >actual &&
+ test_cmp expect actual
+'
+
test_done