git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / 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 11/15] t4038: abstract away SHA-1 specific constants
Date: Sat,  5 Oct 2019 21:12:05 +0000	[thread overview]
Message-ID: <20191005211209.18237-12-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20191005211209.18237-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 d4afe12554..15fc054fdb 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 -a expect actual
 '

  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 ` [PATCH 09/15] t4027: make hash-size independent brian m. carlson
2019-10-05 21:12 ` [PATCH 10/15] t4034: abstract away SHA-1-specific constants brian m. carlson
2019-10-05 21:12 ` brian m. carlson [this message]
2019-10-05 21:12 ` [PATCH 12/15] t4039: " 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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=20191005211209.18237-12-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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).