@@ -15,24 +15,28 @@ test_expect_success 'setup' '
15
15
echo bar content 1 >bar.bin &&
16
16
git add . &&
17
17
git commit -m one &&
18
+ foo1=$(git rev-parse --short HEAD:foo.bin) &&
19
+ bar1=$(git rev-parse --short HEAD:bar.bin) &&
18
20
echo foo content 2 >foo.bin &&
19
21
echo bar content 2 >bar.bin &&
20
22
git commit -a -m two &&
23
+ foo2=$(git rev-parse --short HEAD:foo.bin) &&
24
+ bar2=$(git rev-parse --short HEAD:bar.bin) &&
21
25
echo "*.bin diff=magic" >.gitattributes &&
22
26
git config diff.magic.textconv ./helper &&
23
27
git config diff.magic.cachetextconv true
24
28
'
25
29
26
30
cat > expect << EOF
27
31
diff --git a/bar.bin b/bar.bin
28
- index fcf9166..28283d5 100644
32
+ index $bar1 .. $bar2 100644
29
33
--- a/bar.bin
30
34
+++ b/bar.bin
31
35
@@ -1 +1 @@
32
36
-converted: bar content 1
33
37
+converted: bar content 2
34
38
diff --git a/foo.bin b/foo.bin
35
- index d5b9fe3..1345db2 100644
39
+ index $foo1 .. $foo2 100644
36
40
--- a/foo.bin
37
41
+++ b/foo.bin
38
42
@@ -1 +1 @@
@@ -59,15 +63,15 @@ test_expect_success 'cached textconv does not run helper' '
59
63
60
64
cat > expect << EOF
61
65
diff --git a/bar.bin b/bar.bin
62
- index fcf9166..28283d5 100644
66
+ index $bar1 .. $bar2 100644
63
67
--- a/bar.bin
64
68
+++ b/bar.bin
65
69
@@ -1,2 +1,2 @@
66
70
converted: other
67
71
-converted: bar content 1
68
72
+converted: bar content 2
69
73
diff --git a/foo.bin b/foo.bin
70
- index d5b9fe3..1345db2 100644
74
+ index $foo1 .. $foo2 100644
71
75
--- a/foo.bin
72
76
+++ b/foo.bin
73
77
@@ -1,2 +1,2 @@
@@ -84,15 +88,15 @@ test_expect_success 'changing textconv invalidates cache' '
84
88
85
89
cat > expect << EOF
86
90
diff --git a/bar.bin b/bar.bin
87
- index fcf9166..28283d5 100644
91
+ index $bar1 .. $bar2 100644
88
92
--- a/bar.bin
89
93
+++ b/bar.bin
90
94
@@ -1,2 +1,2 @@
91
95
converted: other
92
96
-converted: bar content 1
93
97
+converted: bar content 2
94
98
diff --git a/foo.bin b/foo.bin
95
- index d5b9fe3..1345db2 100644
99
+ index $foo1 .. $foo2 100644
96
100
--- a/foo.bin
97
101
+++ b/foo.bin
98
102
@@ -1 +1 @@
0 commit comments