terraform/internal
Martin Atkins c4d46e7c6b getmodules: Re-allow git:: source with ref=COMMIT_ID
Earlier versions of this code allowed "ref" to take any value that would
be accepted by "git checkout" as a valid target of a symbolic ref. We
inadvertently accepted a breaking change to upstream go-getter that broke
that as part of introducing a shallow clone optimization, because shallow
clone requires selecting a single branch.

To restore the previous capabilities while retaining the "depth" argument,
here we accept a compromise where "ref" has the stronger requirement of
being a valid named ref in the remote repository if and only if "depth"
is set to a value greater than zero. If depth isn't set or is less than
one, we will do the old behavior of just cloning all of the refs in the
remote repository in full and then switching to refer to the selected
branch, tag, or naked commit ID as a separate step.

This includes a heuristic to generate an additional error message hint if
we get an error from "git clone" and it looks like the user might've been
trying to use "depth" and "ref=COMMIT" together. We can't recognize that
error accurately because it's only reported as human-oriented git command
output, but this heuristic should hopefully minimize situations where we
show it inappropriately.

For now this is a change in the Terraform repository directly, so that we
can expedite the fix to an already-reported regression. After this is
released I tend to also submit a similar set of changes to upstream
go-getter, at which point we can revert Terraform to using the upstream
getter.GitGetter instead of our own local fork.
2021-12-14 11:24:23 -08:00
..
addrs addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
backend Remove 'enhanced' backend type distinction 2021-12-07 16:29:51 -06:00
builtin return diagnostics from provisioners 2021-05-19 11:24:54 -04:00
cloud Update tests for new prompts 2021-11-17 14:20:44 -08:00
command Merge pull request #30142 from hashicorp/chrisarcand/remote-backend-no-workspaces-regression 2021-12-14 09:58:50 -06:00
communicator de-linting 2021-09-01 11:36:21 -04:00
configs addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
copy deprecate helper/copy 2020-10-08 08:42:16 -04:00
dag de-linting 2021-09-01 11:36:21 -04:00
depsfile backend/local: Check dependency lock consistency before any operations 2021-10-01 14:43:58 -07:00
didyoumean didyoumean: move from "helper" to "internal" 2020-10-02 13:35:07 -07:00
e2e Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
earlyconfig addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
experiments experiments: config_driven_move has concluded 2021-11-01 08:46:15 -07:00
getmodules getmodules: Re-allow git:: source with ref=COMMIT_ID 2021-12-14 11:24:23 -08:00
getproviders Fix failing lint check for deprecated x/crypto/openpgp library 2021-11-18 14:59:29 -06:00
grpcwrap Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
helper/slowmessage remove wrapped streams and readline 2021-10-28 11:51:39 -04:00
httpclient Move httpclient/ to internal/httpclient/ 2021-05-17 14:09:07 -07:00
initwd addrs: Expose the registry address parser's error messages 2021-11-30 15:46:16 -08:00
instances instances: Non-existing module instance has no resource instances 2021-12-13 10:03:50 -05:00
ipaddr lang/funcs: Preserve IP address leading zero behavior from Go 1.16 2021-08-17 15:20:05 -07:00
lang funcs: defer close file in funcs 2021-11-16 09:25:49 +01:00
legacy Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
logging use 11 for the panic exit code 2021-10-28 15:34:02 -04:00
modsdir Refactoring of module source addresses and module installation 2021-06-03 08:50:34 -07:00
moduledeps Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
moduletest Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
plans go.mod: go get google.golang.org/protobuf@v1.27.1 2021-10-11 16:37:39 -07:00
plugin internal/plugin[6]: Add generated mocks 2021-10-28 20:16:26 -05:00
plugin6 "Add cloud integration option" 2021-10-28 18:30:01 -07:00
provider-simple Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-simple-v6 Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provider-terraform/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
providercache tools: remove terraform-bundle. (#28876) 2021-06-03 14:08:04 -04:00
providers Move states/ to internal/states/ 2021-05-17 14:09:07 -07:00
provisioner-local-exec/main Move plugin/ and plugin6/ to internal/plugin{,6}/ 2021-05-17 14:09:07 -07:00
provisioners Move configs/ to internal/configs/ 2021-05-17 14:09:07 -07:00
refactoring add AffectedAbsResource to interface 2021-11-16 18:19:11 +00:00
registry command: make module installation interruptible 2021-11-11 12:28:10 +00:00
repl core: Functional-style API for terraform.Context 2021-08-30 13:59:14 -07:00
replacefile Upgrade to Go 1.17 2021-08-17 15:20:05 -07:00
states command/workspace_delete: Allow deleting a workspace with empty husks 2021-10-13 13:54:11 -07:00
terminal remove the use of panicwrap 2021-10-28 11:51:39 -04:00
terraform instances: Non-existing module instance has no resource instances 2021-12-13 10:03:50 -05:00
tfdiags Move tfdiags/ to internal/tfdiags/ 2021-05-17 14:09:07 -07:00
tfplugin5 go.mod: go get google.golang.org/protobuf@v1.27.1 2021-10-11 16:37:39 -07:00
tfplugin6 Merge pull request #29648 from hashicorp/jbardin/tfproto6.1 2021-10-28 16:00:02 -04:00
typeexpr internal/typeexpr: staticcheck 2020-12-02 13:59:19 -05:00