All of lore.kernel.org
 help / color / mirror / Atom feed
From: "brian m. carlson" <sandals@crustytoothpaste.net>
To: <git@vger.kernel.org>
Cc: Jeff King <peff@peff.net>, Duy Nguyen <pclouds@gmail.com>,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>
Subject: [PATCH 10/10] t2203: avoid hard-coded object ID values
Date: Sun,  9 Jun 2019 22:44:00 +0000	[thread overview]
Message-ID: <20190609224400.41557-11-sandals@crustytoothpaste.net> (raw)
In-Reply-To: <20190609224400.41557-1-sandals@crustytoothpaste.net>

In order to make this test work with multiple hash algorithms, compute
the object ID used in this test instead of hard-coding it.

Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net>
---
 t/t2203-add-intent.sh | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/t/t2203-add-intent.sh b/t/t2203-add-intent.sh
index 68e54d5c44..5bbe8dcce4 100755
--- a/t/t2203-add-intent.sh
+++ b/t/t2203-add-intent.sh
@@ -247,12 +247,14 @@ test_expect_success 'diff-files/diff-cached shows ita as new/not-new files' '
 test_expect_success '"diff HEAD" includes ita as new files' '
 	git reset --hard &&
 	echo new >new-ita &&
+	oid=$(git hash-object new-ita) &&
+	oid=$(git rev-parse --short $oid) &&
 	git add -N new-ita &&
 	git diff HEAD >actual &&
-	cat >expected <<-\EOF &&
+	cat >expected <<-EOF &&
 	diff --git a/new-ita b/new-ita
 	new file mode 100644
-	index 0000000..3e75765
+	index 0000000..$oid
 	--- /dev/null
 	+++ b/new-ita
 	@@ -0,0 +1 @@

      parent reply	other threads:[~2019-06-09 22:44 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-09 22:43 [PATCH 00/10] Hash-independent tests, part 4 brian m. carlson
2019-06-09 22:43 ` [PATCH 01/10] t: add helper to convert object IDs to paths brian m. carlson
2019-06-09 22:43 ` [PATCH 02/10] t1410: make hash size independent brian m. carlson
2019-06-09 22:43 ` [PATCH 03/10] t1450: " brian m. carlson
2019-06-10  7:57   ` Eric Sunshine
2019-06-10 22:09     ` brian m. carlson
2019-06-11 23:02   ` Jonathan Tan
2019-06-11 23:20     ` Eric Sunshine
2019-06-11 23:40       ` brian m. carlson
2019-06-11 23:35     ` brian m. carlson
2019-06-09 22:43 ` [PATCH 04/10] t5000: make hash independent brian m. carlson
2019-06-09 22:43 ` [PATCH 05/10] t6030: make test work with SHA-256 brian m. carlson
2019-06-09 22:43 ` [PATCH 06/10] t0027: make hash size independent brian m. carlson
2019-06-09 22:43 ` [PATCH 07/10] t0090: make test pass with SHA-256 brian m. carlson
2019-06-09 22:43 ` [PATCH 08/10] t1007: remove SHA1 prerequisites brian m. carlson
2019-06-09 22:43 ` [PATCH 09/10] t1710: make hash independent brian m. carlson
2019-06-09 22:44 ` brian m. carlson [this message]

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=20190609224400.41557-11-sandals@crustytoothpaste.net \
    --to=sandals@crustytoothpaste.net \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /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.