Skip to content

Commit

Permalink
add ChiselRepository
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Nov 9, 2024
1 parent d311cb9 commit 333c153
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 0 deletions.
4 changes: 4 additions & 0 deletions misc/author/integration_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ export GHQ_ROOT=$tmpdir
ghq get www.mercurial-scm.org/repo/hello
ghq get https://launchpad.net/shutter
ghq get --vcs fossil https://www.sqlite.org/src
ghq get http://chiselapp.com/user/sti/repository/fossil-gui
ghq get --shallow --vcs=git-svn https://svn.apache.org/repos/asf/httpd/httpd
ghq get https://svn.apache.org/repos/asf/subversion
ghq get --shallow hub.darcs.net/byorgey/split
Expand All @@ -28,14 +29,17 @@ export GHQ_ROOT=$tmpdir
test -d $tmpdir/www.mercurial-scm.org/repo/hello/.hg
test -d $tmpdir/launchpad.net/shutter/.bzr
test -f $tmpdir/www.sqlite.org/src/.fslckout
test -f $tmpdir/chiselapp.com/user/sti/repository/fossil-gui/.fslckout
test -d $tmpdir/svn.apache.org/repos/asf/httpd/httpd/.git/svn
test -d $tmpdir/svn.apache.org/repos/asf/subversion/.svn
test -d $tmpdir/hub.darcs.net/byorgey/split/_darcs
test -d $tmpdir/github.com/x-motemen/gore.git/refs

: testing 'ghq list'
cat <<EOF | sort > $tmpdir/expect
chiselapp.com/user/sti/repository/fossil-gui
github.com/x-motemen/ghq
github.com/x-motemen/gore.git
www.mercurial-scm.org/repo/hello
launchpad.net/shutter
www.sqlite.org/src
Expand Down
21 changes: 21 additions & 0 deletions remote_repository.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,25 @@ func (repo *CodeCommitRepository) VCS() (*VCSBackend, *url.URL, error) {
return GitBackend, &u, nil
}

type ChiselRepository struct {
url *url.URL
}

// URL returns URL of the repository
func (repo *ChiselRepository) URL() *url.URL {
return repo.url
}

// IsValid determine if the repository is valid or not
func (repo *ChiselRepository) IsValid() bool {
return true
}

// VCS returns VCSBackend of the repository
func (repo *ChiselRepository) VCS() (*VCSBackend, *url.URL, error) {
return FossilBackend, repo.URL(), nil
}

// OtherRepository represents other repository
type OtherRepository struct {
url *url.URL
Expand Down Expand Up @@ -219,6 +238,8 @@ func NewRemoteRepository(u *url.URL) (RemoteRepository, error) {
return &DarksHubRepository{u}
case "nest.pijul.com":
return &NestPijulRepository{u}
case "chiselapp.com":
return &ChiselRepository{u}
default:
return &OtherRepository{u}
}
Expand Down

0 comments on commit 333c153

Please sign in to comment.