t/lib-diff-alternative: abstract away SHA-1-specific constants

Adjust the test code so that it computes variables for blobs instead of using hard-coded hashes. This makes t4033 and t4050 (the patience and histogram tests) pass. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed May 21, 2018 at 02:01 UTC d29d5001e9614871e05410362b20e1f0a76157a6
1 file changed +8 -4
t/lib-diff-alternative.sh
+8 -4
@@ -59,9 +59,11 @@ int main(int argc, char **argv)
59 }
60 EOF
61
62 - cat >expect <<\EOF
62 + file1=$(git rev-parse --short $(git hash-object file1))
63 + file2=$(git rev-parse --short $(git hash-object file2))
64 + cat >expect <<EOF
65 diff --git a/file1 b/file2
64 -index 6faa5a3..e3af329 100644
66 +index $file1..$file2 100644
67 --- a/file1
68 +++ b/file2
69 @@ -1,26 +1,25 @@
@@ -136,9 +138,11 @@ e
138 f
139 EOF
140
139 - cat >expect <<\EOF
141 + uniq1=$(git rev-parse --short $(git hash-object uniq1))
142 + uniq2=$(git rev-parse --short $(git hash-object uniq2))
143 + cat >expect <<EOF
144 diff --git a/uniq1 b/uniq2
141 -index b414108..0fdf397 100644
145 +index $uniq1..$uniq2 100644
146 --- a/uniq1
147 +++ b/uniq2
148 @@ -1,6 +1,6 @@