]> git.ipfire.org Git - thirdparty/git.git/blame - t/t4133-apply-filenames.sh
Improve test for pthreads flag
[thirdparty/git.git] / t / t4133-apply-filenames.sh
CommitLineData
da915939
AG
1#!/bin/sh
2#
3# Copyright (c) 2010 Andreas Gruenbacher
4#
5
6test_description='git apply filename consistency check'
7
8. ./test-lib.sh
9
10test_expect_success setup '
a48fcd83 11 cat > bad1.patch <<EOF &&
da915939
AG
12diff --git a/f b/f
13new file mode 100644
14index 0000000..d00491f
15--- /dev/null
16+++ b/f-blah
17@@ -0,0 +1 @@
18+1
19EOF
20 cat > bad2.patch <<EOF
21diff --git a/f b/f
22deleted file mode 100644
23index d00491f..0000000
24--- b/f-blah
25+++ /dev/null
26@@ -1 +0,0 @@
27-1
28EOF
29'
30
31test_expect_success 'apply diff with inconsistent filenames in headers' '
a48fcd83
JN
32 test_must_fail git apply bad1.patch 2>err &&
33 grep "inconsistent new filename" err &&
34 test_must_fail git apply bad2.patch 2>err &&
da915939
AG
35 grep "inconsistent old filename" err
36'
37
38test_done