@matheusbsbs / matheus-bagliano / commits / 6a0ebe8ced
Fork 0

t4116 apply --reverse test

The binary patch test needs to be made more careful not to have the postimage blob in the repository in which the patch is applied Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Aug 14, 2006 at 23:24 UTC 6a0ebe8ced66b154a48074d3e3321ff1972ec669
1 file changed +46
t/t4116-apply-reverse.sh new
+46
@@ -0,0 +1,46 @@
1 +#!/bin/sh
2 +#
3 +# Copyright (c) 2005 Junio C Hamano
4 +#
5 +
6 +test_description='git-apply in reverse
7 +
8 +'
9 +
10 +. ./test-lib.sh
11 +
12 +test_expect_success setup '
13 +
14 + for i in a b c d e f g h i j k l m n; do echo $i; done >file1 &&
15 + tr "[ijk]" '\''[\0\1\2]'\'' <file1 >file2 &&
16 +
17 + git add file1 file2 &&
18 + git commit -m initial &&
19 + git tag initial &&
20 +
21 + for i in a b c g h i J K L m o n p q; do echo $i; done >file1 &&
22 + tr "[mon]" '\''[\0\1\2]'\'' <file1 >file2 &&
23 +
24 + git commit -a -m second &&
25 +
26 + git diff --binary -R initial >patch
27 +
28 +'
29 +
30 +test_expect_success 'apply in forward' '
31 +
32 + git apply --index --binary patch &&
33 + git diff initial >diff &&
34 + diff -u /dev/null diff
35 +
36 +'
37 +
38 +test_expect_success 'apply in reverse' '
39 +
40 + git apply --reverse --binary --index patch &&
41 + git diff >diff &&
42 + diff -u /dev/null diff
43 +
44 +'
45 +
46 +test_done