Debian Codegraph @

tests/combine-no-match/run-test

raw
1 #!/bin/sh
2
3 # Test combinediff when no files match at any -p level
4 # Should fall back to showing separate patches
5
6 . ${top_srcdir-.}/tests/common.sh
7
8 # Create first patch with one file
9 cat << EOF > patch1
10 --- /dev/null
11 +++ b/file1.txt
12 @@ -0,0 +1,2 @@
13 +content1
14 +line2
15 EOF
16
17 # Create second patch with completely different file
18 cat << EOF > patch2
19 --- a/completely/different/file2.txt
20 +++ b/completely/different/file2.txt
21 @@ -1,1 +1,2 @@
22 existing
23 +new line
24 EOF
25
26 # Run combinediff - should show separate patches since no files match
27 ${COMBINEDIFF} patch1 patch2 2>errors >actual || exit 1
28 [ -s errors ] && exit 1
29
30 # Should show "only in patch2:" indicating patches weren't combined
31 grep -q "only in patch2:" actual || exit 1
32
33 # Should contain both patches
34 grep -q "file1.txt" actual || exit 1
35 grep -q "file2.txt" actual || exit 1
36
37 exit 0