aboutsummaryrefslogtreecommitdiff
path: root/src/testing/panic_test.go
diff options
context:
space:
mode:
authorDavid Finkel <david.finkel@gmail.com>2024-12-13 20:36:30 -0500
committerGopher Robot <gobot@golang.org>2025-05-13 10:14:36 -0700
commit76f63ee890170f4884f4d213e8150d39d6758ad3 (patch)
tree0d31a02cea0e11d0ad51c66b9546e4ea704ff096 /src/testing/panic_test.go
parent4aeb9ba0deac4eced472a8fc7869a14fb9340d04 (diff)
downloadgo-76f63ee890170f4884f4d213e8150d39d6758ad3.tar.xz
cmd/go: add support for git sha256 hashes
Git's supported SHA 256 object hashes since 2.29[1] in 2021, and Gitlab now has experimental support for sha256 repos. Take rsc@'s suggestion of checking the of the length of the hashes from git ls-remote to determine whether a git repo is using sha256 hashes and decide whether to pass --object-format=sha256 to git init. Unfortunately, just passing --object-format=sha256 wasn't quite enough, though. We also need to decide whether the hash-length is 64 hex bytes or 40 hex bytes when resolving refs to decide whether we've been passed a full commit-hash. To that end, we use git config extensions.objectformat to decide whether the (now guaranteed local) repo is using sha256 hashes and hence 64-hex-byte strings. [1]: lost experimental status in 2.42 from Aug 2023 (https://lore.kernel.org/git/xmqqr0nwp8mv.fsf@gitster.g/) For: #68359 Change-Id: I47f480ab8334128c5d17570fe76722367d0d8ed8 Reviewed-on: https://go-review.googlesource.com/c/go/+/636475 Auto-Submit: Sam Thanawalla <samthanawalla@google.com> LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com> Reviewed-by: Sam Thanawalla <samthanawalla@google.com> Reviewed-by: Michael Matloob <matloob@golang.org> Reviewed-by: Michael Matloob <matloob@google.com> Reviewed-by: David Finkel <david.finkel@gmail.com>
Diffstat (limited to 'src/testing/panic_test.go')
0 files changed, 0 insertions, 0 deletions