~ubuntu-branches/debian/sid/git/sid

« back to all changes in this revision

Viewing changes to t/t4212-log-corrupt.sh

  • Committer: Package Import Robot
  • Author(s): Jonathan Nieder
  • Date: 2013-06-12 07:50:53 UTC
  • mfrom: (1.2.19) (2.1.31 experimental)
  • Revision ID: package-import@ubuntu.com-20130612075053-uue9xe0dq0rvm44y
Tags: 1:1.8.3.1-1
* merge branch debian-experimental
* new upstream point release (see RelNotes/1.8.3.1.txt).
* debian/watch: use xz-compressed tarballs from kernel.org.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
 
 
3
test_description='git log with invalid commit headers'
 
4
 
 
5
. ./test-lib.sh
 
6
 
 
7
test_expect_success 'setup' '
 
8
        test_commit foo &&
 
9
 
 
10
        git cat-file commit HEAD |
 
11
        sed "/^author /s/>/>-<>/" >broken_email.commit &&
 
12
        git hash-object -w -t commit broken_email.commit >broken_email.hash &&
 
13
        git update-ref refs/heads/broken_email $(cat broken_email.hash)
 
14
'
 
15
 
 
16
test_expect_success 'git log with broken author email' '
 
17
        {
 
18
                echo commit $(cat broken_email.hash)
 
19
                echo "Author: A U Thor <author@example.com>"
 
20
                echo "Date:   Thu Jan 1 00:00:00 1970 +0000"
 
21
                echo
 
22
                echo "    foo"
 
23
        } >expect.out &&
 
24
        : >expect.err &&
 
25
 
 
26
        git log broken_email >actual.out 2>actual.err &&
 
27
 
 
28
        test_cmp expect.out actual.out &&
 
29
        test_cmp expect.err actual.err
 
30
'
 
31
 
 
32
test_expect_success 'git log --format with broken author email' '
 
33
        echo "A U Thor+author@example.com+" >expect.out &&
 
34
        : >expect.err &&
 
35
 
 
36
        git log --format="%an+%ae+%ad" broken_email >actual.out 2>actual.err &&
 
37
 
 
38
        test_cmp expect.out actual.out &&
 
39
        test_cmp expect.err actual.err
 
40
'
 
41
 
 
42
test_done