Skip to content

Commit

Permalink
t/lib-diff-alternative: abstract away SHA-1-specific constants
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
bk2204 authored and gitster committed May 21, 2018
1 parent a6c5799 commit d29d500
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions t/lib-diff-alternative.sh
Expand Up @@ -59,9 +59,11 @@ int main(int argc, char **argv)
}
EOF

cat >expect <<\EOF
file1=$(git rev-parse --short $(git hash-object file1))
file2=$(git rev-parse --short $(git hash-object file2))
cat >expect <<EOF
diff --git a/file1 b/file2
index 6faa5a3..e3af329 100644
index $file1..$file2 100644
--- a/file1
+++ b/file2
@@ -1,26 +1,25 @@
Expand Down Expand Up @@ -136,9 +138,11 @@ e
f
EOF

cat >expect <<\EOF
uniq1=$(git rev-parse --short $(git hash-object uniq1))
uniq2=$(git rev-parse --short $(git hash-object uniq2))
cat >expect <<EOF
diff --git a/uniq1 b/uniq2
index b414108..0fdf397 100644
index $uniq1..$uniq2 100644
--- a/uniq1
+++ b/uniq2
@@ -1,6 +1,6 @@
Expand Down

0 comments on commit d29d500

Please sign in to comment.