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
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
37 typedef struct __jmp_buf jmp_buf
[1];
39 #endif /* _SETJMP_H */
41 cat >klibc
/README
<<\EOF
42 This is a simple readme
file.
46 diff --git a
/klibc
/arch
/x86_64
/include
/klibc
/archsetjmp.h b
/include
/arch
/cris
/klibc
/archsetjmp.h
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
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
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
;
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
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
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
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
;
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
125 This is a simple readme
file.
129 diff --git a
/klibc
/README b
/klibc
/arch
/README
130 copy from klibc
/README
131 copy to klibc
/arch
/README
133 +++ b
/klibc
/arch
/README
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'