Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Delete codes for the services turned down (Google Code and JazzHub) #144

Merged
merged 2 commits into from
May 1, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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