Merge branch 'nd/branch-show-rebase-bisect-state'
[git/jnareb-git.git] / t / t4133-apply-filenames.sh
blob2ecb4216b7179ef836836d90a5f76f5e4349ca23
1 #!/bin/sh
3 # Copyright (c) 2010 Andreas Gruenbacher
6 test_description='git apply filename consistency check'
8 . ./test-lib.sh
10 test_expect_success setup '
11 cat > bad1.patch <<EOF &&
12 diff --git a/f b/f
13 new file mode 100644
14 index 0000000..d00491f
15 --- /dev/null
16 +++ b/f-blah
17 @@ -0,0 +1 @@
19 EOF
20 cat > bad2.patch <<EOF
21 diff --git a/f b/f
22 deleted file mode 100644
23 index d00491f..0000000
24 --- b/f-blah
25 +++ /dev/null
26 @@ -1 +0,0 @@
28 EOF
31 test_expect_success 'apply diff with inconsistent filenames in headers' '
32 test_must_fail git apply bad1.patch 2>err &&
33 test_i18ngrep "inconsistent new filename" err &&
34 test_must_fail git apply bad2.patch 2>err &&
35 test_i18ngrep "inconsistent old filename" err
38 test_done