aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/internal/dotgit/dotgit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2017-01-30 16:24:07 +0100
committerGitHub <noreply@github.com>2017-01-30 16:24:07 +0100
commita24e40af0aa2d9d512051269993a1b08c0496d12 (patch)
tree65936a6a365263c93e4b57c3b67aad6a13489e68 /storage/filesystem/internal/dotgit/dotgit.go
parenta48bc6e17ef6298f93ec21cdf1a5e387640673b6 (diff)
parent35378e7db9288e8244f2634a1b47981606731cef (diff)
downloadgo-git-a24e40af0aa2d9d512051269993a1b08c0496d12.tar.gz
Merge pull request #229 from mcuadros/worktree
Worktree and new Repository Contructors
Diffstat (limited to 'storage/filesystem/internal/dotgit/dotgit.go')
-rw-r--r--storage/filesystem/internal/dotgit/dotgit.go11
1 files changed, 11 insertions, 0 deletions
diff --git a/storage/filesystem/internal/dotgit/dotgit.go b/storage/filesystem/internal/dotgit/dotgit.go
index f9763d1..1281b7e 100644
--- a/storage/filesystem/internal/dotgit/dotgit.go
+++ b/storage/filesystem/internal/dotgit/dotgit.go
@@ -18,6 +18,7 @@ const (
suffix = ".git"
packedRefsPath = "packed-refs"
configPath = "config"
+ indexPath = "index"
shallowPath = "shallow"
objectsPath = "objects"
@@ -72,6 +73,16 @@ func (d *DotGit) Config() (billy.File, error) {
return d.fs.Open(configPath)
}
+// IndexWriter returns a file pointer for write to the index file
+func (d *DotGit) IndexWriter() (billy.File, error) {
+ return d.fs.Create(indexPath)
+}
+
+// Index returns a file pointer for read to the index file
+func (d *DotGit) Index() (billy.File, error) {
+ return d.fs.Open(indexPath)
+}
+
// ShallowWriter returns a file pointer for write to the shallow file
func (d *DotGit) ShallowWriter() (billy.File, error) {
return d.fs.Create(shallowPath)