t4048: abstract away SHA-1-specific constants
Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>maint
parent
cf02be8486
commit
fa26d5ede6
|
@ -9,24 +9,27 @@ test_expect_success 'setup binary merge conflict' '
|
||||||
git commit -m one &&
|
git commit -m one &&
|
||||||
echo twoQ2 | q_to_nul >binary &&
|
echo twoQ2 | q_to_nul >binary &&
|
||||||
git commit -a -m two &&
|
git commit -a -m two &&
|
||||||
|
two=$(git rev-parse --short HEAD:binary) &&
|
||||||
git checkout -b branch-binary HEAD^ &&
|
git checkout -b branch-binary HEAD^ &&
|
||||||
echo threeQ3 | q_to_nul >binary &&
|
echo threeQ3 | q_to_nul >binary &&
|
||||||
git commit -a -m three &&
|
git commit -a -m three &&
|
||||||
|
three=$(git rev-parse --short HEAD:binary) &&
|
||||||
test_must_fail git merge master &&
|
test_must_fail git merge master &&
|
||||||
echo resolvedQhooray | q_to_nul >binary &&
|
echo resolvedQhooray | q_to_nul >binary &&
|
||||||
git commit -a -m resolved
|
git commit -a -m resolved &&
|
||||||
|
res=$(git rev-parse --short HEAD:binary)
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/binary b/binary
|
diff --git a/binary b/binary
|
||||||
index 7ea6ded..9563691 100644
|
index $three..$res 100644
|
||||||
Binary files a/binary and b/binary differ
|
Binary files a/binary and b/binary differ
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/binary b/binary
|
diff --git a/binary b/binary
|
||||||
index 6197570..9563691 100644
|
index $two..$res 100644
|
||||||
Binary files a/binary and b/binary differ
|
Binary files a/binary and b/binary differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff -m indicates binary-ness' '
|
test_expect_success 'diff -m indicates binary-ness' '
|
||||||
|
@ -34,11 +37,11 @@ test_expect_success 'diff -m indicates binary-ness' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --combined binary
|
diff --combined binary
|
||||||
index 7ea6ded,6197570..9563691
|
index $three,$two..$res
|
||||||
Binary files differ
|
Binary files differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff -c indicates binary-ness' '
|
test_expect_success 'diff -c indicates binary-ness' '
|
||||||
|
@ -46,11 +49,11 @@ test_expect_success 'diff -c indicates binary-ness' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --cc binary
|
diff --cc binary
|
||||||
index 7ea6ded,6197570..9563691
|
index $three,$two..$res
|
||||||
Binary files differ
|
Binary files differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff --cc indicates binary-ness' '
|
test_expect_success 'diff --cc indicates binary-ness' '
|
||||||
|
@ -62,23 +65,26 @@ test_expect_success 'setup non-binary with binary attribute' '
|
||||||
git checkout master &&
|
git checkout master &&
|
||||||
test_commit one text &&
|
test_commit one text &&
|
||||||
test_commit two text &&
|
test_commit two text &&
|
||||||
|
two=$(git rev-parse --short HEAD:text) &&
|
||||||
git checkout -b branch-text HEAD^ &&
|
git checkout -b branch-text HEAD^ &&
|
||||||
test_commit three text &&
|
test_commit three text &&
|
||||||
|
three=$(git rev-parse --short HEAD:text) &&
|
||||||
test_must_fail git merge master &&
|
test_must_fail git merge master &&
|
||||||
test_commit resolved text &&
|
test_commit resolved text &&
|
||||||
|
res=$(git rev-parse --short HEAD:text) &&
|
||||||
echo text -diff >.gitattributes
|
echo text -diff >.gitattributes
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/text b/text
|
diff --git a/text b/text
|
||||||
index 2bdf67a..2ab19ae 100644
|
index $three..$res 100644
|
||||||
Binary files a/text and b/text differ
|
Binary files a/text and b/text differ
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/text b/text
|
diff --git a/text b/text
|
||||||
index f719efd..2ab19ae 100644
|
index $two..$res 100644
|
||||||
Binary files a/text and b/text differ
|
Binary files a/text and b/text differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff -m respects binary attribute' '
|
test_expect_success 'diff -m respects binary attribute' '
|
||||||
|
@ -86,11 +92,11 @@ test_expect_success 'diff -m respects binary attribute' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --combined text
|
diff --combined text
|
||||||
index 2bdf67a,f719efd..2ab19ae
|
index $three,$two..$res
|
||||||
Binary files differ
|
Binary files differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff -c respects binary attribute' '
|
test_expect_success 'diff -c respects binary attribute' '
|
||||||
|
@ -98,11 +104,11 @@ test_expect_success 'diff -c respects binary attribute' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --cc text
|
diff --cc text
|
||||||
index 2bdf67a,f719efd..2ab19ae
|
index $three,$two..$res
|
||||||
Binary files differ
|
Binary files differ
|
||||||
EOF
|
EOF
|
||||||
test_expect_success 'diff --cc respects binary attribute' '
|
test_expect_success 'diff --cc respects binary attribute' '
|
||||||
|
@ -115,11 +121,11 @@ test_expect_success 'setup textconv attribute' '
|
||||||
git config diff.upcase.textconv "tr a-z A-Z <"
|
git config diff.upcase.textconv "tr a-z A-Z <"
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/text b/text
|
diff --git a/text b/text
|
||||||
index 2bdf67a..2ab19ae 100644
|
index $three..$res 100644
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@ -1 +1 @@
|
@@ -1 +1 @@
|
||||||
|
@ -128,7 +134,7 @@ index 2bdf67a..2ab19ae 100644
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --git a/text b/text
|
diff --git a/text b/text
|
||||||
index f719efd..2ab19ae 100644
|
index $two..$res 100644
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@ -1 +1 @@
|
@@ -1 +1 @@
|
||||||
|
@ -140,11 +146,11 @@ test_expect_success 'diff -m respects textconv attribute' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --combined text
|
diff --combined text
|
||||||
index 2bdf67a,f719efd..2ab19ae
|
index $three,$two..$res
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@@ -1,1 -1,1 +1,1 @@@
|
@@@ -1,1 -1,1 +1,1 @@@
|
||||||
|
@ -157,11 +163,11 @@ test_expect_success 'diff -c respects textconv attribute' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
resolved
|
resolved
|
||||||
|
|
||||||
diff --cc text
|
diff --cc text
|
||||||
index 2bdf67a,f719efd..2ab19ae
|
index $three,$two..$res
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@@ -1,1 -1,1 +1,1 @@@
|
@@@ -1,1 -1,1 +1,1 @@@
|
||||||
|
@ -174,9 +180,9 @@ test_expect_success 'diff --cc respects textconv attribute' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
diff --combined text
|
diff --combined text
|
||||||
index 2bdf67a,f719efd..2ab19ae
|
index $three,$two..$res
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@@ -1,1 -1,1 +1,1 @@@
|
@@@ -1,1 -1,1 +1,1 @@@
|
||||||
|
@ -190,9 +196,9 @@ test_expect_success 'diff-tree plumbing does not respect textconv' '
|
||||||
test_cmp expect actual
|
test_cmp expect actual
|
||||||
'
|
'
|
||||||
|
|
||||||
cat >expect <<'EOF'
|
cat >expect <<EOF
|
||||||
diff --cc text
|
diff --cc text
|
||||||
index 2bdf67a,f719efd..0000000
|
index $three,$two..0000000
|
||||||
--- a/text
|
--- a/text
|
||||||
+++ b/text
|
+++ b/text
|
||||||
@@@ -1,1 -1,1 +1,5 @@@
|
@@@ -1,1 -1,1 +1,5 @@@
|
||||||
|
|
Loading…
Reference in New Issue