@matheusbsbs / matheus-bagliano / commits / 74ad99b1d8
Fork 0

t5512: abstract away SHA-1-specific constants

Adjust the test so that it computes variables for object IDs instead of using hard-coded hashes. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

brian m. carlson committed Dec 21, 2019 at 19:49 UTC 74ad99b1d8e891623a523ead2097f628d78583d8
1 file changed +9 -8
t/t5512-ls-remote.sh
+9 -8
@@ -230,9 +230,10 @@ test_expect_success 'ls-remote --symref' '
230 '
231
232 test_expect_success 'ls-remote with filtered symref (refname)' '
233 - cat >expect <<-\EOF &&
233 + rev=$(git rev-parse HEAD) &&
234 + cat >expect <<-EOF &&
235 ref: refs/heads/master HEAD
235 - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a HEAD
236 + $rev HEAD
237 EOF
238 # Protocol v2 supports sending symrefs for refs other than HEAD, so use
239 # protocol v0 here.
@@ -242,10 +243,10 @@ test_expect_success 'ls-remote with filtered symref (refname)' '
243
244 test_expect_failure 'ls-remote with filtered symref (--heads)' '
245 git symbolic-ref refs/heads/foo refs/tags/mark &&
245 - cat >expect <<-\EOF &&
246 + cat >expect <<-EOF &&
247 ref: refs/tags/mark refs/heads/foo
247 - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo
248 - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master
248 + $rev refs/heads/foo
249 + $rev refs/heads/master
250 EOF
251 # Protocol v2 supports sending symrefs for refs other than HEAD, so use
252 # protocol v0 here.
@@ -254,9 +255,9 @@ test_expect_failure 'ls-remote with filtered symref (--heads)' '
255 '
256
257 test_expect_success 'ls-remote --symref omits filtered-out matches' '
257 - cat >expect <<-\EOF &&
258 - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/foo
259 - 1bd44cb9d13204b0fe1958db0082f5028a16eb3a refs/heads/master
258 + cat >expect <<-EOF &&
259 + $rev refs/heads/foo
260 + $rev refs/heads/master
261 EOF
262 # Protocol v2 supports sending symrefs for refs other than HEAD, so use
263 # protocol v0 here.