Fix FTBFS on $HOME managed with git.
This is a cherry-pick of
https://github.com/golang/go/commit/
e2a9ea035d73df84c813132417366e8e01777c8d
cmd/go/internal/modload: suppress the 'go mod init' hint for GOROOT more aggressively
Previously, we suppressed a `to create a module there, run: … go mod
init' warning only if the config file itself (such as .git/config) was
found in GOROOT. However, our release tarballs don't include the
.git/config, so that case was not encountered, and the warning could
occur based on a config file found in some parent directory (outside
of GOROOT entirely).
Instead, skip the directory walk completely if the working directory
is anywhere in GOROOT.
Fixes #34191
Change-Id: I9f774901bfbb53b700407c4882f37d6339d023fe
Reviewed-on: https://go-review.googlesource.com/c/go/+/223340
Run-TryBot: Bryan C. Mills <bcmills@google.com>
Reviewed-by: Jay Conrod <jayconrod@google.com>
Gbp-Pq: Name 0003-Fix-FTBFS-on-HOME-managed-with-git.patch
Disable test for UserHomeDir.
On Debian buildds, the user home dir does not exist, so this test fails.
Gbp-Pq: Name 0001-Disable-test-for-UserHomeDir.patch