summaryrefslogtreecommitdiff
path: root/tests/git-binary-diff
diff options
context:
space:
mode:
authorAndreas Gruenbacher <agruen@suse.de>2010-04-22 23:25:12 +0200
committerAndreas Gruenbacher <agruen@suse.de>2010-04-23 21:43:45 +0200
commit310f4c406aec408dcf5fc03d38ebe9f499088506 (patch)
tree8d89d81128fbcc37422abf763b6ee8c5a5ecfdcd /tests/git-binary-diff
parent30a7405dfbfa1f1e7186685f1e8a80b967286815 (diff)
downloadpatch-310f4c406aec408dcf5fc03d38ebe9f499088506.tar.gz
Complain when fed git binary patches
* src/common.h (enum diff): New enumeration GIT_BINARY_DIFF. * src/pch.c (intuit_diff_type): Recognize git binary patches. * src/patch.c (main): Complain when fed git binary patches. * tests/git-binary-diff: New test case. * tests/Makefile.am (TESTS): Add test case.
Diffstat (limited to 'tests/git-binary-diff')
-rw-r--r--tests/git-binary-diff30
1 files changed, 30 insertions, 0 deletions
diff --git a/tests/git-binary-diff b/tests/git-binary-diff
new file mode 100644
index 0000000..13a06b0
--- /dev/null
+++ b/tests/git-binary-diff
@@ -0,0 +1,30 @@
+# Copyright (C) 2010 Free Software Foundation, Inc.
+#
+# Copying and distribution of this file, with or without modification,
+# in any medium, are permitted without royalty provided the copyright
+# notice and this notice are preserved.
+
+. $srcdir/test-lib.sh
+
+require_cat
+require_diff
+use_local_patch
+use_tmpdir
+
+cat > f.diff <<EOF
+diff --git a/zeroes b/zeroes
+new file mode 100644
+index 0000000000000000000000000000000000000000..06d7405020018ddf3cacee90fd4af10487da3d20
+GIT binary patch
+literal 1024
+ScmZQz7zLvtFd70QH3R?z00031
+
+literal 0
+HcmV?d00001
+
+EOF
+
+check 'patch -p1 < f.diff || echo "Status: $?"' <<EOF
+File zeroes: git binary diffs are not supported.
+Status: 1
+EOF