diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-12 23:03:30 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-12 23:03:30 +0100 |
commit | 498dbf7dc92e288641f1af1acc52704150e8a6c0 (patch) | |
tree | 7be1fab61a2eead003f07249c0312f71decaccf7 /storage/filesystem/internal/dotgit/dotgit.go | |
parent | 87a84b1cb90149cf81e76be46811341a30e4a367 (diff) | |
download | go-git-498dbf7dc92e288641f1af1acc52704150e8a6c0.tar.gz |
storage: git.Storer move to storage.Storer and module handling
Diffstat (limited to 'storage/filesystem/internal/dotgit/dotgit.go')
-rw-r--r-- | storage/filesystem/internal/dotgit/dotgit.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go index accf9ca..360b3d1 100644 --- a/storage/filesystem/internal/dotgit/dotgit.go +++ b/storage/filesystem/internal/dotgit/dotgit.go @@ -20,10 +20,10 @@ const ( configPath = "config" indexPath = "index" shallowPath = "shallow" - - objectsPath = "objects" - packPath = "pack" - refsPath = "refs" + modulePath = "module" + objectsPath = "objects" + packPath = "pack" + refsPath = "refs" packExt = ".pack" idxExt = ".idx" @@ -390,6 +390,11 @@ func (d *DotGit) readReferenceFile(refsPath, refFile string) (ref *plumbing.Refe return plumbing.NewReferenceFromStrings(refFile, line), nil } +// Module return a billy.Filesystem poiting to the module folder +func (d *DotGit) Module(name string) billy.Filesystem { + return d.fs.Dir(d.fs.Join(modulePath, name)) +} + func isHex(s string) bool { for _, b := range []byte(s) { if isNum(b) { |