forked from twaugh/patchutils
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathrun-test
More file actions
executable file
·37 lines (32 loc) · 935 Bytes
/
run-test
File metadata and controls
executable file
·37 lines (32 loc) · 935 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
#!/bin/sh
# GitHub issue #157: Binary files should be filtered by file number
. ${top_srcdir-.}/tests/common.sh
cat << 'EOF' > diff
diff --git a/file1.txt b/file1.txt
new file mode 100644
--- /dev/null
+++ b/file1.txt
@@ -0,0 +1 @@
+a
diff --git a/file1.bin b/file1.bin
new file mode 100644
Binary files /dev/null and b/file1.bin differ
diff --git a/file2.txt b/file2.txt
new file mode 100644
--- /dev/null
+++ b/file2.txt
@@ -0,0 +1 @@
+b
diff --git a/file2.bin b/file2.bin
new file mode 100644
Binary files /dev/null and b/file2.bin differ
EOF
# Test -F2: should only show file #2 (file1.bin), NOT file2.bin
# Note: using --git-extended-diffs=include to test binary file filtering
${FILTERDIFF} --git-extended-diffs=include -F2 diff 2>errors >output || exit 1
[ -s errors ] && exit 1
cat << 'EOF' | cmp - output || exit 1
diff --git a/file1.bin b/file1.bin
new file mode 100644
Binary files /dev/null and b/file1.bin differ
EOF