All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: <git@vger.kernel.org>
Cc: Stefan Beller <stefanbeller@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH 09/15] t4027: make hash-size independent
Date: Sat,  5 Oct 2019 21:12:03 +0000	[thread overview]
Message-ID: <20191005211209.18237-10-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20191005211209.18237-1-sandals@crustytoothpaste.net>

Instead of hard-coding the length of an object ID, look this value up
using the translation tables.  Similarly, compute input data for invalid
submodule entries using the tables as well.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t4027-diff-submodule.sh | 16 ++++++++--------
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/t/t4027-diff-submodule.sh b/t/t4027-diff-submodule.sh
index 9aa8e2b39b..e29deaf4a5 100755
--- a/t/t4027-diff-submodule.sh
+++ b/t/t4027-diff-submodule.sh
@@ -6,6 +6,7 @@ test_description='difference in submodules'
 . "$TEST_DIRECTORY"/diff-lib.sh
 
 test_expect_success setup '
+	test_oid_init &&
 	test_tick &&
 	test_create_repo sub &&
 	(
@@ -36,7 +37,8 @@ test_expect_success setup '
 '
 
 test_expect_success 'git diff --raw HEAD' '
-	git diff --raw --abbrev=40 HEAD >actual &&
+	hexsz=$(test_oid hexsz) &&
+	git diff --raw --abbrev=$hexsz HEAD >actual &&
 	test_cmp expect actual
 '
 
@@ -245,23 +247,21 @@ test_expect_success 'git diff (empty submodule dir)' '
 '
 
 test_expect_success 'conflicted submodule setup' '
-
-	# 39 efs
-	c=fffffffffffffffffffffffffffffffffffffff &&
+	c=$(test_oid ff_1) &&
 	(
 		echo "000000 $ZERO_OID 0	sub" &&
 		echo "160000 1$c 1	sub" &&
 		echo "160000 2$c 2	sub" &&
 		echo "160000 3$c 3	sub"
 	) | git update-index --index-info &&
-	echo >expect.nosub '\''diff --cc sub
+	echo >expect.nosub "diff --cc sub
 index 2ffffff,3ffffff..0000000
 --- a/sub
 +++ b/sub
 @@@ -1,1 -1,1 +1,1 @@@
-- Subproject commit 2fffffffffffffffffffffffffffffffffffffff
- -Subproject commit 3fffffffffffffffffffffffffffffffffffffff
-++Subproject commit 0000000000000000000000000000000000000000'\'' &&
+- Subproject commit 2$c
+ -Subproject commit 3$c
+++Subproject commit $ZERO_OID" &&
 
 	hh=$(git rev-parse HEAD) &&
 	sed -e "s/$ZERO_OID/$hh/" expect.nosub >expect.withsub

  parent reply	other threads:[~2019-10-05 21:12 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-05 21:11 [PATCH 00/15] SHA-256 test fixes, part 6 brian m. carlson
2019-10-05 21:11 ` [PATCH 01/15] t/oid-info: allow looking up hash algorithm name brian m. carlson
2019-10-05 21:11 ` [PATCH 02/15] t/oid-info: add empty tree and empty blob values brian m. carlson
2019-10-05 21:11 ` [PATCH 03/15] rev-parse: add an --object-format option brian m. carlson
2019-10-08 11:51   ` Derrick Stolee
2019-10-08 19:31     ` brian m. carlson
2019-10-05 21:11 ` [PATCH 04/15] t1305: avoid comparing extensions brian m. carlson
2019-10-05 21:11 ` [PATCH 05/15] t3429: remove SHA1 annotation brian m. carlson
2019-10-05 21:12 ` [PATCH 06/15] t4010: abstract away SHA-1-specific constants brian m. carlson
2019-10-05 21:12 ` [PATCH 07/15] t4011: " brian m. carlson
2019-10-08 12:21   ` Derrick Stolee
2019-10-08 12:33     ` Bert Wesarg
2019-10-08 12:38       ` Derrick Stolee
2019-10-08 19:40       ` brian m. carlson
2019-10-05 21:12 ` [PATCH 08/15] t4015: " brian m. carlson
2019-10-08 12:31   ` Derrick Stolee
2019-10-05 21:12 ` brian m. carlson [this message]
2019-10-05 21:12 ` [PATCH 10/15] t4034: " brian m. carlson
2019-10-05 21:12 ` [PATCH 11/15] t4038: abstract away SHA-1 specific constants brian m. carlson
2019-10-05 21:12 ` [PATCH 12/15] t4039: abstract away SHA-1-specific constants brian m. carlson
2019-10-05 21:12 ` [PATCH 13/15] t4044: update test to work with SHA-256 brian m. carlson
2019-10-05 21:12 ` [PATCH 14/15] t4045: make hash-size independent brian m. carlson
2019-10-05 21:12 ` [PATCH 15/15] t4048: abstract away SHA-1-specific constants brian m. carlson
2019-10-08 12:40 ` [PATCH 00/15] SHA-256 test fixes, part 6 Derrick Stolee

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20191005211209.18237-10-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=stefanbeller@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.