@@ -737,6 +737,107 @@ test_expect_success 'log.decorate configuration' '
737737
738738'
739739
740+ test_expect_success ' decorate-refs with glob' '
741+ cat >expect.decorate <<-\EOF &&
742+ Merge-tag-reach
743+ Merge-tags-octopus-a-and-octopus-b
744+ seventh
745+ octopus-b (octopus-b)
746+ octopus-a (octopus-a)
747+ reach
748+ EOF
749+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
750+ --decorate-refs="heads/octopus*" >actual &&
751+ test_cmp expect.decorate actual
752+ '
753+
754+ test_expect_success ' decorate-refs without globs' '
755+ cat >expect.decorate <<-\EOF &&
756+ Merge-tag-reach
757+ Merge-tags-octopus-a-and-octopus-b
758+ seventh
759+ octopus-b
760+ octopus-a
761+ reach (tag: reach)
762+ EOF
763+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
764+ --decorate-refs="tags/reach" >actual &&
765+ test_cmp expect.decorate actual
766+ '
767+
768+ test_expect_success ' multiple decorate-refs' '
769+ cat >expect.decorate <<-\EOF &&
770+ Merge-tag-reach
771+ Merge-tags-octopus-a-and-octopus-b
772+ seventh
773+ octopus-b (octopus-b)
774+ octopus-a (octopus-a)
775+ reach (tag: reach)
776+ EOF
777+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
778+ --decorate-refs="heads/octopus*" \
779+ --decorate-refs="tags/reach" >actual &&
780+ test_cmp expect.decorate actual
781+ '
782+
783+ test_expect_success ' decorate-refs-exclude with glob' '
784+ cat >expect.decorate <<-\EOF &&
785+ Merge-tag-reach (HEAD -> master)
786+ Merge-tags-octopus-a-and-octopus-b
787+ seventh (tag: seventh)
788+ octopus-b (tag: octopus-b)
789+ octopus-a (tag: octopus-a)
790+ reach (tag: reach, reach)
791+ EOF
792+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
793+ --decorate-refs-exclude="heads/octopus*" >actual &&
794+ test_cmp expect.decorate actual
795+ '
796+
797+ test_expect_success ' decorate-refs-exclude without globs' '
798+ cat >expect.decorate <<-\EOF &&
799+ Merge-tag-reach (HEAD -> master)
800+ Merge-tags-octopus-a-and-octopus-b
801+ seventh (tag: seventh)
802+ octopus-b (tag: octopus-b, octopus-b)
803+ octopus-a (tag: octopus-a, octopus-a)
804+ reach (reach)
805+ EOF
806+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
807+ --decorate-refs-exclude="tags/reach" >actual &&
808+ test_cmp expect.decorate actual
809+ '
810+
811+ test_expect_success ' multiple decorate-refs-exclude' '
812+ cat >expect.decorate <<-\EOF &&
813+ Merge-tag-reach (HEAD -> master)
814+ Merge-tags-octopus-a-and-octopus-b
815+ seventh (tag: seventh)
816+ octopus-b (tag: octopus-b)
817+ octopus-a (tag: octopus-a)
818+ reach (reach)
819+ EOF
820+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
821+ --decorate-refs-exclude="heads/octopus*" \
822+ --decorate-refs-exclude="tags/reach" >actual &&
823+ test_cmp expect.decorate actual
824+ '
825+
826+ test_expect_success ' decorate-refs and decorate-refs-exclude' '
827+ cat >expect.decorate <<-\EOF &&
828+ Merge-tag-reach (master)
829+ Merge-tags-octopus-a-and-octopus-b
830+ seventh
831+ octopus-b
832+ octopus-a
833+ reach (reach)
834+ EOF
835+ git log -n6 --decorate=short --pretty="tformat:%f%d" \
836+ --decorate-refs="heads/*" \
837+ --decorate-refs-exclude="heads/oc*" >actual &&
838+ test_cmp expect.decorate actual
839+ '
840+
740841test_expect_success ' log.decorate config parsing' '
741842 git log --oneline --decorate=full >expect.full &&
742843 git log --oneline --decorate=short >expect.short &&
0 commit comments