2.36 fast-export regression fix
[git.git] / t / t4112-apply-renames.sh
blobd53aa4222ea3c1405247e07d62fc8efed83daa5d
1 #!/bin/sh
3 # Copyright (c) 2005 Junio C Hamano
6 test_description='git apply should not get confused with rename/copy.
11 TEST_PASSES_SANITIZE_LEAK=true
12 . ./test-lib.sh
14 # setup
16 mkdir -p klibc/arch/x86_64/include/klibc
18 cat >klibc/arch/x86_64/include/klibc/archsetjmp.h <<\EOF
20 * arch/x86_64/include/klibc/archsetjmp.h
23 #ifndef _KLIBC_ARCHSETJMP_H
24 #define _KLIBC_ARCHSETJMP_H
26 struct __jmp_buf {
27 unsigned long __rbx;
28 unsigned long __rsp;
29 unsigned long __rbp;
30 unsigned long __r12;
31 unsigned long __r13;
32 unsigned long __r14;
33 unsigned long __r15;
34 unsigned long __rip;
37 typedef struct __jmp_buf jmp_buf[1];
39 #endif /* _SETJMP_H */
40 EOF
41 cat >klibc/README <<\EOF
42 This is a simple readme file.
43 EOF
45 cat >patch <<\EOF
46 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/cris/klibc/archsetjmp.h
47 similarity index 76%
48 copy from klibc/arch/x86_64/include/klibc/archsetjmp.h
49 copy to include/arch/cris/klibc/archsetjmp.h
50 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
51 +++ b/include/arch/cris/klibc/archsetjmp.h
52 @@ -1,21 +1,24 @@
54 - * arch/x86_64/include/klibc/archsetjmp.h
55 + * arch/cris/include/klibc/archsetjmp.h
58 #ifndef _KLIBC_ARCHSETJMP_H
59 #define _KLIBC_ARCHSETJMP_H
61 struct __jmp_buf {
62 - unsigned long __rbx;
63 - unsigned long __rsp;
64 - unsigned long __rbp;
65 - unsigned long __r12;
66 - unsigned long __r13;
67 - unsigned long __r14;
68 - unsigned long __r15;
69 - unsigned long __rip;
70 + unsigned long __r0;
71 + unsigned long __r1;
72 + unsigned long __r2;
73 + unsigned long __r3;
74 + unsigned long __r4;
75 + unsigned long __r5;
76 + unsigned long __r6;
77 + unsigned long __r7;
78 + unsigned long __r8;
79 + unsigned long __sp;
80 + unsigned long __srp;
83 typedef struct __jmp_buf jmp_buf[1];
85 -#endif /* _SETJMP_H */
86 +#endif /* _KLIBC_ARCHSETJMP_H */
87 diff --git a/klibc/arch/x86_64/include/klibc/archsetjmp.h b/include/arch/m32r/klibc/archsetjmp.h
88 similarity index 66%
89 rename from klibc/arch/x86_64/include/klibc/archsetjmp.h
90 rename to include/arch/m32r/klibc/archsetjmp.h
91 --- a/klibc/arch/x86_64/include/klibc/archsetjmp.h
92 +++ b/include/arch/m32r/klibc/archsetjmp.h
93 @@ -1,21 +1,21 @@
95 - * arch/x86_64/include/klibc/archsetjmp.h
96 + * arch/m32r/include/klibc/archsetjmp.h
99 #ifndef _KLIBC_ARCHSETJMP_H
100 #define _KLIBC_ARCHSETJMP_H
102 struct __jmp_buf {
103 - unsigned long __rbx;
104 - unsigned long __rsp;
105 - unsigned long __rbp;
106 + unsigned long __r8;
107 + unsigned long __r9;
108 + unsigned long __r10;
109 + unsigned long __r11;
110 unsigned long __r12;
111 unsigned long __r13;
112 unsigned long __r14;
113 unsigned long __r15;
114 - unsigned long __rip;
117 typedef struct __jmp_buf jmp_buf[1];
119 -#endif /* _SETJMP_H */
120 +#endif /* _KLIBC_ARCHSETJMP_H */
121 diff --git a/klibc/README b/klibc/README
122 --- a/klibc/README
123 +++ b/klibc/README
124 @@ -1,1 +1,4 @@
125 This is a simple readme file.
126 +And we add a few
127 +lines at the
128 +end of it.
129 diff --git a/klibc/README b/klibc/arch/README
130 copy from klibc/README
131 copy to klibc/arch/README
132 --- a/klibc/README
133 +++ b/klibc/arch/README
134 @@ -1,1 +1,3 @@
135 This is a simple readme file.
136 +And we copy it to one level down, and
137 +add a few lines at the end of it.
140 find klibc -type f -print | xargs git update-index --add --
142 test_expect_success 'check rename/copy patch' 'git apply --check patch'
144 test_expect_success 'apply rename/copy patch' 'git apply --index patch'
146 test_done