This repository has been archived by the owner on Aug 22, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* gh-19: abstracted out the parsing logic and started adding support points for svn and mercurial repositories * gh-19: reordered imports
- Loading branch information
Mya Pitzeruse
committed
Jan 21, 2019
1 parent
ba98602
commit 4bf2f50
Showing
16 changed files
with
287 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ package remotes | |
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/mjpitz/gitfs/pkg/config" | ||
) | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
package urls | ||
|
||
import ( | ||
"gopkg.in/src-d/go-billy.v4" | ||
) | ||
|
||
type Cloner interface { | ||
Clone(url *URL, depth int, fs billy.Filesystem) error | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package urls | ||
|
||
import ( | ||
"fmt" | ||
|
||
"gopkg.in/src-d/go-billy.v4" | ||
) | ||
|
||
func NewCloner() Cloner { | ||
cloners := make(map[VCS]Cloner) | ||
cloners[GIT] = &gitcloner{} | ||
|
||
return &compositecloner{ | ||
cloners: cloners, | ||
} | ||
} | ||
|
||
var _ Cloner = &compositecloner{} | ||
|
||
type compositecloner struct { | ||
cloners map[VCS]Cloner | ||
} | ||
|
||
func (cc *compositecloner) Clone(url *URL, depth int, fs billy.Filesystem) error { | ||
cloner, ok := cc.cloners[url.VCS] | ||
if !ok { | ||
return fmt.Errorf("unsupported vcs: %s", url.VCS) | ||
} | ||
|
||
return cloner.Clone(url, depth, fs) | ||
} | ||
|
||
|
Oops, something went wrong.