Skip to content

Commit

Permalink
Merge pull request #144 from motemen/good-bye-google-code
Browse files Browse the repository at this point in the history
Delete codes for the services turned down (Google Code and JazzHub)
  • Loading branch information
Songmu authored May 1, 2019
2 parents 8e5d917 + c806193 commit c76d696
Showing 1 changed file with 0 additions and 51 deletions.
51 changes: 0 additions & 51 deletions remote_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package main
import (
"fmt"
"net/url"
"regexp"
"strings"

"github.com/motemen/ghq/cmdutil"
Expand Down Expand Up @@ -64,30 +63,6 @@ func (repo *GitHubGistRepository) VCS() (*VCSBackend, *url.URL) {
return GitBackend, repo.URL()
}

type GoogleCodeRepository struct {
url *url.URL
}

func (repo *GoogleCodeRepository) URL() *url.URL {
return repo.url
}

var validGoogleCodePathPattern = regexp.MustCompile(`^/p/[^/]+/?$`)

func (repo *GoogleCodeRepository) IsValid() bool {
return validGoogleCodePathPattern.MatchString(repo.url.Path)
}

func (repo *GoogleCodeRepository) VCS() (*VCSBackend, *url.URL) {
if cmdutil.RunSilently("hg", "identify", repo.url.String()) == nil {
return MercurialBackend, repo.URL()
} else if cmdutil.RunSilently("git", "ls-remote", repo.url.String()) == nil {
return GitBackend, repo.URL()
} else {
return nil, nil
}
}

type DarksHubRepository struct {
url *url.URL
}
Expand All @@ -104,24 +79,6 @@ func (repo *DarksHubRepository) VCS() (*VCSBackend, *url.URL) {
return DarcsBackend, repo.URL()
}

type BluemixRepository struct {
url *url.URL
}

func (repo *BluemixRepository) URL() *url.URL {
return repo.url
}

var validBluemixPathPattern = regexp.MustCompile(`^/git/[^/]+/[^/]+$`)

func (repo *BluemixRepository) IsValid() bool {
return validBluemixPathPattern.MatchString(repo.url.Path)
}

func (repo *BluemixRepository) VCS() (*VCSBackend, *url.URL) {
return GitBackend, repo.URL()
}

type OtherRepository struct {
url *url.URL
}
Expand Down Expand Up @@ -182,18 +139,10 @@ func NewRemoteRepository(url *url.URL) (RemoteRepository, error) {
return &GitHubGistRepository{url}, nil
}

if url.Host == "code.google.com" {
return &GoogleCodeRepository{url}, nil
}

if url.Host == "hub.darcs.net" {
return &DarksHubRepository{url}, nil
}

if url.Host == "hub.jazz.net" {
return &BluemixRepository{url}, nil
}

gheHosts, err := GitConfigAll("ghq.ghe.host")

if err != nil {
Expand Down

0 comments on commit c76d696

Please sign in to comment.