Skip to content

Commit 4f5dc53

Browse files
authored
Merge pull request #68 from lafriks/patch-1
make filer.FromGit exported
2 parents e39156e + 98fc459 commit 4f5dc53

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

licensedb/filer/filer.go

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -118,10 +118,11 @@ func FromGitURL(url string) (Filer, error) {
118118
if err != nil {
119119
return nil, errors.Wrapf(err, "could not clone repo from %s", url)
120120
}
121-
return fromGit(repo, "")
121+
return FromGit(repo, "")
122122
}
123123

124-
func fromGit(repo *git.Repository, headRef plumbing.ReferenceName) (Filer, error) {
124+
// FromGit returns a Filer that allows accessing all the files in a Git repository
125+
func FromGit(repo *git.Repository, headRef plumbing.ReferenceName) (Filer, error) {
125126
var head *plumbing.Reference
126127
var err error
127128
if headRef == "" {
@@ -242,7 +243,7 @@ func FromSiva(path string) (Filer, error) {
242243
if err != nil {
243244
return nil, errors.Wrapf(err, "failed to iterate over references in Siva file %s", path)
244245
}
245-
return fromGit(repo, head)
246+
return FromGit(repo, head)
246247
}
247248

248249
type zipNode struct {

0 commit comments

Comments
 (0)