tests/t0108-patch.sh (view raw)
1#!/bin/sh
2
3test_description='Check content on patch page'
4. ./setup.sh
5
6test_expect_success 'generate foo/patch' '
7 cgit_query "url=foo/patch" >tmp
8'
9
10test_expect_success 'find `From:` line' '
11 grep "^From: " tmp
12'
13
14test_expect_success 'find `Date:` line' '
15 grep "^Date: " tmp
16'
17
18test_expect_success 'find `Subject:` line' '
19 grep "^Subject: commit 5" tmp
20'
21
22test_expect_success 'find `cgit` signature' '
23 tail -1 tmp | grep "^cgit"
24'
25
26test_expect_success 'find initial commit' '
27 root=$(git --git-dir="$PWD/repos/foo/.git" rev-list --max-parents=0 HEAD)
28'
29
30test_expect_success 'generate patch for initial commit' '
31 cgit_query "url=foo/patch&id=$root" >tmp
32'
33
34test_expect_success 'find `cgit` signature' '
35 tail -1 tmp | grep "^cgit"
36'
37
38test_done