Debian Codegraph @

tests/fullheader1/run-test

raw
1 #!/bin/sh
2
3 # This is a filterdiff(1) testcase.
4 # Deal with git format-patch output more intelligently.
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 cat <<"EOF" > git-output
9 diff --git a/ChangeLog b/ChangeLog
10 index aff7a94..304bef5 100644
11 --- a/ChangeLog
12 +++ b/ChangeLog
13 @@ -1 +1 @@
14 -Should hide diff and index lines
15 +when not selected
16 diff --git a/otherfile b/otherfile
17 index 5feceb9..dde7898 10644
18 --- a/otherfile
19 +++ b/otherfile
20 @@ -1 +1 @@
21 -This file will
22 +be selected
23 EOF
24
25 ${LSDIFF} --git-prefixes=strip -n git-output 2>errors >index || exit 1
26 [ -s errors ] && exit 1
27 cat <<"EOF" | cmp - index || exit 1
28 1 ChangeLog
29 8 otherfile
30 EOF
31
32 ${FILTERDIFF} --git-prefixes=strip -i otherfile git-output 2>errors >otherfile.patch || exit 1
33 [ -s errors ] && exit 1
34 cat <<"EOF" | cmp - otherfile.patch || exit 1
35 diff --git a/otherfile b/otherfile
36 index 5feceb9..dde7898 10644
37 --- a/otherfile
38 +++ b/otherfile
39 @@ -1 +1 @@
40 -This file will
41 +be selected
42 EOF