aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/internal/dotgit/dotgit.go
diff options
context:
space:
mode:
Diffstat (limited to 'storage/filesystem/internal/dotgit/dotgit.go')
-rw-r--r--storage/filesystem/internal/dotgit/dotgit.go13
1 files changed, 9 insertions, 4 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go
index 6646e18..b46f827 100644
--- a/storage/filesystem/internal/dotgit/dotgit.go
+++ b/storage/filesystem/internal/dotgit/dotgit.go
@@ -21,13 +21,13 @@ const (
configPath = "config"
indexPath = "index"
shallowPath = "shallow"
+ modulePath = "module"
+ objectsPath = "objects"
+ packPath = "pack"
+ refsPath = "refs"
tmpPackedRefsPrefix = "._packed-refs"
- objectsPath = "objects"
- packPath = "pack"
- refsPath = "refs"
-
packExt = ".pack"
idxExt = ".idx"
)
@@ -454,6 +454,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) {