func (d *DotGit) ShallowWriter() (billy.File, error) {
	return d.fs.Create(shallowPath)
}
ShallowWriter returns a file pointer for write to the shallow file
package dotgit
import (
	"bufio"
	"errors"
	"fmt"
	"io"
	stdioutil "io/ioutil"
	"os"
	"path/filepath"
	"strings"
	"time"
	"gopkg.in/src-d/go-billy.v4/osfs"
	"gopkg.in/src-d/go-git.v4/plumbing"
	"gopkg.in/src-d/go-git.v4/utils/ioutil"
	"gopkg.in/src-d/go-billy.v4"
)
const (
	suffix         = ".git"
	packedRefsPath = "packed-refs"
	configPath     = "config"
	indexPath      = "index"
	shallowPath    = "shallow"
	modulePath     = "modules"
	objectsPath    = "objects"
	packPath       = "pack"
	refsPath       = "refs"
	tmpPackedRefsPrefix = "._packed-refs"
	packExt = ".pack"
	idxExt  = ".idx"
)
var (
	ErrNotFound = errors.New("path not found")
	ErrIdxNotFound = errors.New("idx file not found")
	ErrPackfileNotFound = errors.New("packfile not found")
	ErrConfigNotFound = errors.New("config file not found")
	ErrPackedRefsDuplicatedRef = errors.New("duplicated ref found in packed-ref file")
	ErrPackedRefsBadFormat = errors.New("malformed packed-ref")
	ErrSymRefTargetNotFound = errors.New("symbolic reference target not found")
)
type DotGit struct {
	fs billy.Filesystem
}
func New(fs billy.Filesystem) *DotGit {
	return &DotGit{fs: fs}
}
func (d *DotGit) Initialize() error {
	mustExists := []string{
		d.fs.Join("objects", "info"),
		d.fs.Join("objects", "pack"),
		d.fs.Join("refs", "heads"),
		d.fs.Join("refs", "tags"),
	}
	for _, path := range mustExists {
		_, err := d.fs.Stat(path)
		if err == nil {
			continue
		}
		if !os.IsNotExist(err) {
			return err
		}
		if err := d.fs.MkdirAll(path, os.ModeDir|os.ModePerm); err != nil {
			return err
		}
	}
	return nil
}
func (d *DotGit) ConfigWriter() (billy.File, error) {
	return d.fs.Create(configPath)
}
func (d *DotGit) Config() (billy.File, error) {
	return d.fs.Open(configPath)
}
func (d *DotGit) IndexWriter() (billy.File, error) {
	return d.fs.Create(indexPath)
}
func (d *DotGit) Index() (billy.File, error) {
	return d.fs.Open(indexPath)
}