#!/bin/sh global test_description := ''format-patch mime headers and extra headers do not conflict'' source ./test-lib.sh test_expect_success 'create commit with utf-8 body' ' echo content >file && git add file && git commit -m one && echo more >>file && git commit -a -m "two utf-8 body: ñ" ' test_expect_success 'patch has mime headers' ' rm -f 0001-two.patch && git format-patch HEAD^ && grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch ' test_expect_success 'patch has mime and extra headers' ' rm -f 0001-two.patch && git config format.headers "x-foo: bar" && git format-patch HEAD^ && grep -i "x-foo: bar" 0001-two.patch && grep -i "content-type: text/plain; charset=utf-8" 0001-two.patch ' test_done (CommandList children: [ (Assignment keyword: Assign_None pairs: [ (assign_pair lhs: (LhsName name:test_description) op: Equal rhs: {(SQ <"format-patch mime headers and extra headers do not conflict">)} spids: [4] ) ] spids: [4] ) (C {(.)} {(./test-lib.sh)}) (C {(test_expect_success)} {(SQ <"create commit with utf-8 body">)} { (SQ <"\n"> <"\techo content >file &&\n"> <"\tgit add file &&\n"> <"\tgit commit -m one &&\n"> <"\techo more >>file &&\n"> <"\tgit commit -a -m \"two\n"> <"\n"> <"\tutf-8 body: \u00f1\"\n"> ) } ) (C {(test_expect_success)} {(SQ <"patch has mime headers">)} { (SQ <"\n"> <"\trm -f 0001-two.patch &&\n"> <"\tgit format-patch HEAD^ &&\n"> <"\tgrep -i \"content-type: text/plain; charset=utf-8\" 0001-two.patch\n"> ) } ) (C {(test_expect_success)} {(SQ <"patch has mime and extra headers">)} { (SQ <"\n"> <"\trm -f 0001-two.patch &&\n"> <"\tgit config format.headers \"x-foo: bar\" &&\n"> <"\tgit format-patch HEAD^ &&\n"> <"\tgrep -i \"x-foo: bar\" 0001-two.patch &&\n"> <"\tgrep -i \"content-type: text/plain; charset=utf-8\" 0001-two.patch\n"> ) } ) (C {(test_done)}) ] )