zip: set GIT_DIR in test when using bare repositories

If git has safe.bareRepository=explicit set, operations on bare git
repos will fail unless --git-dir or GIT_DIR is set. Set GIT_DIR in the
parts of the zip test that use bare repos to allow the tests to pass in
those circumstances.

See CL 489915 for the change setting GIT_DIR for git operations on bare
repositories in cmd/go.

Change-Id: I1f8ae9ed2b687a58d533fa605ed9ad4b5cbb8549
Reviewed-on: https://go-review.googlesource.com/c/mod/+/605937
Auto-Submit: Michael Matloob <matloob@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Reviewed-by: Dmitri Shuralyov <dmitshur@golang.org>
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
2 files changed
tree: 2c017946735fea6f385bbddf9e889c29473373ab
  1. gosumcheck/
  2. internal/
  3. modfile/
  4. module/
  5. semver/
  6. sumdb/
  7. zip/
  8. codereview.cfg
  9. go.mod
  10. go.sum
  11. LICENSE
  12. PATENTS
  13. README.md
README.md

mod

PkgGoDev

This repository holds packages for writing tools that work directly with Go module mechanics. That is, it is for direct manipulation of Go modules themselves.

It is NOT about supporting general development tools that need to do things like load packages in module mode. That use case, where modules are incidental rather than the focus, should remain in x/tools, specifically x/tools/go/packages.

The specific case of loading packages should still be done by invoking the go command, which remains the single point of truth for package loading algorithms.