From: "brian m. carlson" <sandals@crustytoothpaste.net> To: <git@vger.kernel.org> Cc: Eric Sunshine <sunshine@sunshineco.com> Subject: [PATCH v4 11/39] t7063: make hash size independent Date: Sun, 26 Jul 2020 19:53:56 +0000 [thread overview] Message-ID: <20200726195424.626969-12-sandals@crustytoothpaste.net> (raw) In-Reply-To: <20200726195424.626969-1-sandals@crustytoothpaste.net> Use test_oid instead of hard-coding a fixed size all-zeros object ID. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> --- t/t7063-status-untracked-cache.sh | 151 ++++++++++++++++-------------- 1 file changed, 81 insertions(+), 70 deletions(-) diff --git a/t/t7063-status-untracked-cache.sh b/t/t7063-status-untracked-cache.sh index 428cff9cf3..c713c0dc3f 100755 --- a/t/t7063-status-untracked-cache.sh +++ b/t/t7063-status-untracked-cache.sh @@ -75,14 +75,24 @@ test_expect_success 'setup' ' touch one two three done/one dtwo/two dthree/three && git add one two done/one && : >.git/info/exclude && - git update-index --untracked-cache + git update-index --untracked-cache && + test_oid_cache <<-EOF + root sha1:e6fcc8f2ee31bae321d66afd183fcb7237afae6e + root sha256:b90c672088c015b9c83876e919da311bad4cd39639fb139f988af6a11493b974 + + exclude sha1:13263c0978fb9fad16b2d580fb800b6d811c3ff0 + exclude sha256:fe4aaa1bbbbce4cb8f73426748a14c5ad6026b26f90505a0bf2494b165a5b76c + + done sha1:1946f0437f90c5005533cbe1736a6451ca301714 + done sha256:7f079501d79f665b3acc50f5e0e9e94509084d5032ac20113a37dd5029b757cc + EOF ' test_expect_success 'untracked cache is empty' ' test-tool dump-untracked-cache >../actual && cat >../expect-empty <<EOF && -info/exclude 0000000000000000000000000000000000000000 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $ZERO_OID +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 EOF @@ -100,17 +110,17 @@ EOF cat >../dump.expect <<EOF && info/exclude $EMPTY_BLOB -core.excludesfile 0000000000000000000000000000000000000000 +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ 0000000000000000000000000000000000000000 recurse valid +/ $ZERO_OID recurse valid dthree/ dtwo/ three -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid three -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF @@ -190,18 +200,18 @@ test_expect_success 'verify untracked cache dump' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && info/exclude $EMPTY_BLOB -core.excludesfile 0000000000000000000000000000000000000000 +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ 0000000000000000000000000000000000000000 recurse valid +/ $ZERO_OID recurse valid dthree/ dtwo/ four three -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid three -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -239,18 +249,18 @@ test_expect_success 'verify untracked cache dump' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && info/exclude $EMPTY_BLOB -core.excludesfile 0000000000000000000000000000000000000000 +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dthree/ dtwo/ three -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid three -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -284,16 +294,16 @@ EOF test_expect_success 'verify untracked cache dump' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -303,14 +313,14 @@ test_expect_success 'move two from tracked to untracked' ' git rm --cached two && test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/ $(test_oid root) recurse +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -342,17 +352,17 @@ EOF test_expect_success 'verify untracked cache dump' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ two -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -362,14 +372,14 @@ test_expect_success 'move two from untracked to tracked' ' git add two && test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/ $(test_oid root) recurse +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -401,16 +411,16 @@ EOF test_expect_success 'verify untracked cache dump' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -447,16 +457,16 @@ EOF test_expect_success 'untracked cache correct after commit' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ -/done/ 0000000000000000000000000000000000000000 recurse valid -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/ $ZERO_OID recurse valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -508,17 +518,17 @@ EOF test_expect_success 'untracked cache correct after status' ' test-tool dump-untracked-cache >../actual && cat >../expect <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ -/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid +/done/ $(test_oid done) recurse valid five -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect ../actual @@ -580,22 +590,22 @@ EOF test_expect_success 'verify untracked cache dump (sparse/subdirs)' ' test-tool dump-untracked-cache >../actual && cat >../expect-from-test-dump <<EOF && -info/exclude 13263c0978fb9fad16b2d580fb800b6d811c3ff0 -core.excludesfile 0000000000000000000000000000000000000000 +info/exclude $(test_oid exclude) +core.excludesfile $ZERO_OID exclude_per_dir .gitignore flags 00000006 -/ e6fcc8f2ee31bae321d66afd183fcb7237afae6e recurse valid +/ $(test_oid root) recurse valid .gitignore dtwo/ -/done/ 1946f0437f90c5005533cbe1736a6451ca301714 recurse valid +/done/ $(test_oid done) recurse valid five sub/ -/done/sub/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/sub/ $ZERO_OID recurse check_only valid sub/ -/done/sub/sub/ 0000000000000000000000000000000000000000 recurse check_only valid +/done/sub/sub/ $ZERO_OID recurse check_only valid file -/dthree/ 0000000000000000000000000000000000000000 recurse check_only valid -/dtwo/ 0000000000000000000000000000000000000000 recurse check_only valid +/dthree/ $ZERO_OID recurse check_only valid +/dtwo/ $ZERO_OID recurse check_only valid two EOF test_cmp ../expect-from-test-dump ../actual @@ -695,6 +705,7 @@ test_expect_success 'using --untracked-cache does not fail when core.untrackedCa ' test_expect_success 'setting core.untrackedCache to keep' ' + touch ../expect-from-test-dump && git config core.untrackedCache keep && git update-index --untracked-cache && test-tool dump-untracked-cache >../actual && @@ -806,8 +817,8 @@ test_expect_success '"status" after file replacement should be clean with UC=tru test-tool dump-untracked-cache >../actual && grep -F "recurse valid" ../actual >../actual.grep && cat >../expect.grep <<EOF && -/ 0000000000000000000000000000000000000000 recurse valid -/two/ 0000000000000000000000000000000000000000 recurse valid +/ $ZERO_OID recurse valid +/two/ $ZERO_OID recurse valid EOF status_is_clean && test_cmp ../expect.grep ../actual.grep
next prev parent reply other threads:[~2020-07-26 19:55 UTC|newest] Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top 2020-07-26 19:53 [PATCH v4 00/39] SHA-256, part 3/3 brian m. carlson 2020-07-26 19:53 ` [PATCH v4 01/39] t: make test-bloom initialize repository brian m. carlson 2020-07-26 19:53 ` [PATCH v4 02/39] t1001: use $ZERO_OID brian m. carlson 2020-07-26 19:53 ` [PATCH v4 03/39] t3305: make hash agnostic brian m. carlson 2020-07-26 19:53 ` [PATCH v4 04/39] t3404: prepare 'short SHA-1 collision' tests for SHA-256 brian m. carlson 2020-07-26 22:31 ` Eric Sunshine 2020-07-26 19:53 ` [PATCH v4 05/39] t6100: make hash size independent brian m. carlson 2020-07-26 19:53 ` [PATCH v4 06/39] t6101: " brian m. carlson 2020-07-26 19:53 ` [PATCH v4 07/39] t6301: " brian m. carlson 2020-07-26 19:53 ` [PATCH v4 08/39] t6500: specify test values for SHA-256 brian m. carlson 2020-07-26 19:53 ` [PATCH v4 09/39] t6501: avoid hard-coded objects brian m. carlson 2020-07-26 19:53 ` [PATCH v4 10/39] t7003: compute appropriate length constant brian m. carlson 2020-07-26 19:53 ` brian m. carlson [this message] 2020-07-26 22:40 ` [PATCH v4 11/39] t7063: make hash size independent Eric Sunshine 2020-07-26 19:53 ` [PATCH v4 12/39] t7201: abstract away SHA-1-specific constants brian m. carlson 2020-07-26 22:54 ` Eric Sunshine 2020-07-26 19:53 ` [PATCH v4 13/39] t7102: " brian m. carlson 2020-07-26 19:53 ` [PATCH v4 14/39] t7400: make hash size independent brian m. carlson 2020-07-26 19:54 ` [PATCH v4 15/39] t7405: " brian m. carlson 2020-07-26 19:54 ` [PATCH v4 16/39] t7506: avoid checking for SHA-1-specific constants brian m. carlson 2020-07-26 19:54 ` [PATCH v4 17/39] t7508: use $ZERO_OID instead of hard-coded constant brian m. carlson 2020-07-26 19:54 ` [PATCH v4 18/39] t8002: make hash size independent brian m. carlson 2020-07-26 22:49 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 19/39] t8003: " brian m. carlson 2020-07-26 19:54 ` [PATCH v4 20/39] t8011: " brian m. carlson 2020-07-26 23:00 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 21/39] t9300: abstract away SHA-1-specific constants brian m. carlson 2020-07-26 23:14 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 22/39] t9300: use $ZERO_OID instead of hard-coded object ID brian m. carlson 2020-07-26 19:54 ` [PATCH v4 23/39] t9301: make hash size independent brian m. carlson 2020-07-26 19:54 ` [PATCH v4 24/39] t9350: " brian m. carlson 2020-07-26 19:54 ` [PATCH v4 25/39] t9500: ensure that algorithm info is preserved in config brian m. carlson 2020-07-26 19:54 ` [PATCH v4 26/39] t9700: make hash size independent brian m. carlson 2020-07-26 19:54 ` [PATCH v4 27/39] t5308: make test work with SHA-256 brian m. carlson 2020-07-26 19:54 ` [PATCH v4 28/39] t0410: mark test with SHA1 prerequisite brian m. carlson 2020-07-26 19:54 ` [PATCH v4 29/39] http-fetch: set up git directory before parsing pack hashes brian m. carlson 2020-07-26 23:28 ` Eric Sunshine 2020-07-26 23:30 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 30/39] builtin/verify-pack: implement an --object-format option brian m. carlson 2020-07-26 21:29 ` Eric Sunshine 2020-07-26 22:56 ` brian m. carlson 2020-07-26 19:54 ` [PATCH v4 31/39] bundle: add new version for use with SHA-256 brian m. carlson 2020-07-26 22:18 ` Eric Sunshine 2020-07-26 22:59 ` brian m. carlson 2020-07-26 19:54 ` [PATCH v4 32/39] setup: add support for reading extensions.objectformat brian m. carlson 2020-07-26 23:34 ` Eric Sunshine 2020-07-26 23:41 ` brian m. carlson 2020-07-26 19:54 ` [PATCH v4 33/39] Enable SHA-256 support by default brian m. carlson 2020-07-26 23:41 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 34/39] t: add test_oid option to select hash algorithm brian m. carlson 2020-07-26 19:54 ` [PATCH v4 35/39] t: allow testing different hash algorithms via environment brian m. carlson 2020-07-26 19:54 ` [PATCH v4 36/39] t: make SHA1 prerequisite depend on default hash brian m. carlson 2020-07-26 23:52 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 37/39] ci: run tests with SHA-256 brian m. carlson 2020-07-26 23:54 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 38/39] docs: add documentation for extensions.objectFormat brian m. carlson 2020-07-26 23:56 ` Eric Sunshine 2020-07-26 19:54 ` [PATCH v4 39/39] t: remove test_oid_init in tests brian m. carlson
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=20200726195424.626969-12-sandals@crustytoothpaste.net \ --to=sandals@crustytoothpaste.net \ --cc=git@vger.kernel.org \ --cc=sunshine@sunshineco.com \ --subject='Re: [PATCH v4 11/39] t7063: make hash size independent' \ /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
Code repositories for project(s) associated with this 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).