]>
git.cameronkatri.com Git - cgit.git/blob - tests/t0108-patch.sh
3 test_description
='Check content on patch page'
6 test_expect_success
'generate foo/patch' '
7 cgit_query "url=foo/patch" >tmp
10 test_expect_success
'find `From:` line' '
14 test_expect_success
'find `Date:` line' '
18 test_expect_success
'find `Subject:` line' '
19 grep "^Subject: commit 5" tmp
22 test_expect_success
'find `cgit` signature' '
23 tail -2 tmp | head -1 | grep "^cgit"
26 test_expect_success
'compare with output of git-format-patch(1)' '
27 CGIT_VERSION=$(sed -n "s/CGIT_VERSION = //p" ../../VERSION) &&
28 git --git-dir="$PWD/repos/foo/.git" format-patch --subject-prefix="" --signature="cgit $CGIT_VERSION" --stdout HEAD^ >tmp2 &&
29 strip_headers <tmp >tmp_ &&
33 test_expect_success
'find initial commit' '
34 root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD)
37 test_expect_success
'generate patch for initial commit' '
38 cgit_query "url=foo/patch&id=$root" >tmp
41 test_expect_success
'find `cgit` signature' '
42 tail -2 tmp | head -1 | grep "^cgit"
45 test_expect_success
'generate patches for multiple commits' '
46 id=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD) &&
47 id2=$(git --git-dir="$PWD/repos/foo/.git" rev-parse HEAD~3) &&
48 cgit_query "url=foo/patch&id=$id&id2=$id2" >tmp
51 test_expect_success
'find `cgit` signature' '
52 tail -2 tmp | head -1 | grep "^cgit"
55 test_expect_success
'compare with output of git-format-patch(1)' '
56 CGIT_VERSION=$(sed -n "s/CGIT_VERSION = //p" ../../VERSION) &&
57 git --git-dir="$PWD/repos/foo/.git" format-patch -N --subject-prefix="" --signature="cgit $CGIT_VERSION" --stdout HEAD~3..HEAD >tmp2 &&
58 strip_headers <tmp >tmp_ &&