git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: <git@vger.kernel.org>
Cc: Derrick Stolee <dstolee@microsoft.com>,
	Stefan Beller <stefanbeller@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH v2 11/15] t4038: abstract away SHA-1 specific constants
Date: Mon, 28 Oct 2019 00:59:03 +0000	[thread overview]
Message-ID: <20191028005907.24985-12-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20191028005907.24985-1-sandals@crustytoothpaste.net>

Compute several object IDs that exist in expected output, since we don't
care about the specific object IDs, only that the format of the output
is syntactically correct.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t4038-diff-combined.sh | 19 +++++++++++++------
 1 file changed, 13 insertions(+), 6 deletions(-)

diff --git a/t/t4038-diff-combined.sh b/t/t4038-diff-combined.sh
index b9d876efa2..b5a56895e8 100755
--- a/t/t4038-diff-combined.sh
+++ b/t/t4038-diff-combined.sh
@@ -440,11 +440,13 @@ test_expect_success 'setup for --combined-all-paths' '
 	git branch side2c &&
 	git checkout side1c &&
 	test_seq 1 10 >filename-side1c &&
+	side1cf=$(git hash-object filename-side1c) &&
 	git add filename-side1c &&
 	git commit -m with &&
 	git checkout side2c &&
 	test_seq 1 9 >filename-side2c &&
 	echo ten >>filename-side2c &&
+	side2cf=$(git hash-object filename-side2c) &&
 	git add filename-side2c &&
 	git commit -m iam &&
 	git checkout -b mergery side1c &&
@@ -452,13 +454,14 @@ test_expect_success 'setup for --combined-all-paths' '
 	git rm filename-side1c &&
 	echo eleven >>filename-side2c &&
 	git mv filename-side2c filename-merged &&
+	mergedf=$(git hash-object filename-merged) &&
 	git add filename-merged &&
 	git commit
 '
 
 test_expect_success '--combined-all-paths and --raw' '
-	cat <<-\EOF >expect &&
-	::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR	filename-side1c	filename-side2c	filename-merged
+	cat <<-EOF >expect &&
+	::100644 100644 100644 $side1cf $side2cf $mergedf RR	filename-side1c	filename-side2c	filename-merged
 	EOF
 	git diff-tree -c -M --raw --combined-all-paths HEAD >actual.tmp &&
 	sed 1d <actual.tmp >actual &&
@@ -482,11 +485,13 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'
 	git checkout side1d &&
 	test_seq 1 10 >"$(printf "file\twith\ttabs")" &&
 	git add file* &&
+	side1df=$(git hash-object *tabs) &&
 	git commit -m with &&
 	git checkout side2d &&
 	test_seq 1 9 >"$(printf "i\tam\ttabbed")" &&
 	echo ten >>"$(printf "i\tam\ttabbed")" &&
 	git add *tabbed &&
+	side2df=$(git hash-object *tabbed) &&
 	git commit -m iam &&
 	git checkout -b funny-names-mergery side1d &&
 	git merge --no-commit side2d &&
@@ -494,12 +499,14 @@ test_expect_success FUNNYNAMES 'setup for --combined-all-paths with funny names'
 	echo eleven >>"$(printf "i\tam\ttabbed")" &&
 	git mv "$(printf "i\tam\ttabbed")" "$(printf "fickle\tnaming")" &&
 	git add fickle* &&
-	git commit
+	headf=$(git hash-object fickle*) &&
+	git commit &&
+	head=$(git rev-parse HEAD)
 '
 
 test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names' '
-	cat <<-\EOF >expect &&
-	::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR	"file\twith\ttabs"	"i\tam\ttabbed"	"fickle\tnaming"
+	cat <<-EOF >expect &&
+	::100644 100644 100644 $side1df $side2df $headf RR	"file\twith\ttabs"	"i\tam\ttabbed"	"fickle\tnaming"
 	EOF
 	git diff-tree -c -M --raw --combined-all-paths HEAD >actual.tmp &&
 	sed 1d <actual.tmp >actual &&
@@ -507,7 +514,7 @@ test_expect_success FUNNYNAMES '--combined-all-paths and --raw and funny names'
 '
 
 test_expect_success FUNNYNAMES '--combined-all-paths and --raw -and -z and funny names' '
-	printf "aaf8087c3cbd4db8e185a2d074cf27c53cfb75d7\0::100644 100644 100644 f00c965d8307308469e537302baa73048488f162 088bd5d92c2a8e0203ca8e7e4c2a5c692f6ae3f7 333b9c62519f285e1854830ade0fe1ef1d40ee1b RR\0file\twith\ttabs\0i\tam\ttabbed\0fickle\tnaming\0" >expect &&
+	printf "$head\0::100644 100644 100644 $side1df $side2df $headf RR\0file\twith\ttabs\0i\tam\ttabbed\0fickle\tnaming\0" >expect &&
 	git diff-tree -c -M --raw --combined-all-paths -z HEAD >actual &&
 	test_cmp expect actual
 '

  parent reply	other threads:[~2019-10-28  0:59 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-10-28  0:58 [PATCH v2 00/15] SHA-256 test fixes, part 6 brian m. carlson
2019-10-28  0:58 ` [PATCH v2 01/15] t/oid-info: allow looking up hash algorithm name brian m. carlson
2019-10-28  0:58 ` [PATCH v2 02/15] t/oid-info: add empty tree and empty blob values brian m. carlson
2019-10-28  0:58 ` [PATCH v2 03/15] rev-parse: add a --show-object-format option brian m. carlson
2019-10-28  0:58 ` [PATCH v2 04/15] t1305: avoid comparing extensions brian m. carlson
2019-10-28  0:58 ` [PATCH v2 05/15] t3429: remove SHA1 annotation brian m. carlson
2019-10-28  0:58 ` [PATCH v2 06/15] t4010: abstract away SHA-1-specific constants brian m. carlson
2019-10-28  0:58 ` [PATCH v2 07/15] t4011: " brian m. carlson
2019-10-28  2:56   ` Junio C Hamano
2019-10-28 23:59     ` brian m. carlson
2019-10-28  0:59 ` [PATCH v2 08/15] t4015: " brian m. carlson
2019-10-28  0:59 ` [PATCH v2 09/15] t4027: make hash-size independent brian m. carlson
2019-10-28  0:59 ` [PATCH v2 10/15] t4034: abstract away SHA-1-specific constants brian m. carlson
2019-10-28  0:59 ` brian m. carlson [this message]
2019-10-28  0:59 ` [PATCH v2 12/15] t4039: " brian m. carlson
2019-10-28  0:59 ` [PATCH v2 13/15] t4044: update test to work with SHA-256 brian m. carlson
2019-10-28  0:59 ` [PATCH v2 14/15] t4045: make hash-size independent brian m. carlson
2019-10-28  0:59 ` [PATCH v2 15/15] t4048: abstract away SHA-1-specific constants brian m. carlson
2019-10-29  2:26 ` [PATCH v2 00/15] SHA-256 test fixes, part 6 Junio C Hamano

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=20191028005907.24985-12-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=dstolee@microsoft.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).