diff options
author | brian m. carlson <sandals@crustytoothpaste.net> | 2018-05-21 02:01:42 (GMT) |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-05-21 04:55:48 (GMT) |
commit | d29d5001e9614871e05410362b20e1f0a76157a6 (patch) | |
tree | a55dfee235dd36a3eb45fba3ad0112234ea765a0 /t/lib-diff-alternative.sh | |
parent | a6c5799052cb803d189b0f37c9be83ba6a3202ab (diff) | |
download | git-d29d5001e9614871e05410362b20e1f0a76157a6.zip git-d29d5001e9614871e05410362b20e1f0a76157a6.tar.gz git-d29d5001e9614871e05410362b20e1f0a76157a6.tar.bz2 |
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>
Diffstat (limited to 't/lib-diff-alternative.sh')
-rw-r--r-- | t/lib-diff-alternative.sh | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/t/lib-diff-alternative.sh b/t/lib-diff-alternative.sh index 8b4dbf2..8d1e408 100644 --- a/t/lib-diff-alternative.sh +++ b/t/lib-diff-alternative.sh @@ -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 @@ @@ -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 @@ |