MCPcopy
hub / github.com/hashicorp/go-getter / TestGitGetter_Detector

Function TestGitGetter_Detector

get_git_test.go:660–741  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

658}
659
660func TestGitGetter_Detector(t *testing.T) {
661 cases := []struct {
662 Input string
663 Output string
664 }{
665 {
666 "git@github.com:hashicorp/foo.git",
667 "ssh://git@github.com/hashicorp/foo.git",
668 },
669 {
670 "git@github.com:org/project.git?ref=test-branch",
671 "ssh://git@github.com/org/project.git?ref=test-branch",
672 },
673 {
674 "git@github.com:hashicorp/foo.git//bar",
675 "ssh://git@github.com/hashicorp/foo.git//bar",
676 },
677 {
678 "git@github.com:hashicorp/foo.git?foo=bar",
679 "ssh://git@github.com/hashicorp/foo.git?foo=bar",
680 },
681 {
682 "git@github.xyz.com:org/project.git",
683 "ssh://git@github.xyz.com/org/project.git",
684 },
685 {
686 "git@github.xyz.com:org/project.git?ref=test-branch",
687 "ssh://git@github.xyz.com/org/project.git?ref=test-branch",
688 },
689 {
690 "git@github.xyz.com:org/project.git//module/a",
691 "ssh://git@github.xyz.com/org/project.git//module/a",
692 },
693 {
694 "git@github.xyz.com:org/project.git//module/a?ref=test-branch",
695 "ssh://git@github.xyz.com/org/project.git//module/a?ref=test-branch",
696 },
697 {
698 "git::ssh://git@git.example.com:2222/hashicorp/foo.git",
699 "ssh://git@git.example.com:2222/hashicorp/foo.git",
700 },
701 {
702 "bitbucket.org/hashicorp/tf-test-git",
703 "https://bitbucket.org/hashicorp/tf-test-git.git",
704 },
705 {
706 "bitbucket.org/hashicorp/tf-test-git.git",
707 "https://bitbucket.org/hashicorp/tf-test-git.git",
708 },
709 {
710 "git::ssh://git@git.example.com:2222/hashicorp/foo.git",
711 "ssh://git@git.example.com:2222/hashicorp/foo.git",
712 },
713 }
714
715 pwd := "/pwd"
716 getter := &GitGetter{
717 Detectors: []Detector{

Callers

nothing calls this directly

Calls 1

DetectFunction · 0.85

Tested by

no test coverage detected