Skip to content

Commit d29d500

Browse files
bk2204gitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent a6c5799 commit d29d500

File tree

1 file changed

+8
-4
lines changed

1 file changed

+8
-4
lines changed

t/lib-diff-alternative.sh

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,11 @@ int main(int argc, char **argv)
5959
}
6060
EOF
6161

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
6365
diff --git a/file1 b/file2
64-
index 6faa5a3..e3af329 100644
66+
index $file1..$file2 100644
6567
--- a/file1
6668
+++ b/file2
6769
@@ -1,26 +1,25 @@
@@ -136,9 +138,11 @@ e
136138
f
137139
EOF
138140

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
140144
diff --git a/uniq1 b/uniq2
141-
index b414108..0fdf397 100644
145+
index $uniq1..$uniq2 100644
142146
--- a/uniq1
143147
+++ b/uniq2
144148
@@ -1,6 +1,6 @@

0 commit comments

Comments
 (0)