aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/dotgit/dotgit.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-05-24 09:15:51 +0200
committerMáximo Cuadros <mcuadros@gmail.com>2020-05-24 09:15:51 +0200
commitc80979499a2177f3e172b6d89dabaa0bf64e81d1 (patch)
tree53b50491cc72557cabc436f2784590cf449228d0 /storage/filesystem/dotgit/dotgit.go
parent936faa404ef02c88bde6a62663a6e1a4831c1fb3 (diff)
downloadgo-git-c80979499a2177f3e172b6d89dabaa0bf64e81d1.tar.gz
Revert "Merge pull request #20 from quorumcontrol/feature/other-configs"
This reverts commit 3127ad9a44a2ee935502816065dfe39f494f583d, reversing changes made to 73c52edaad2dae256be61bd1dbbab08e1092f58e.
Diffstat (limited to 'storage/filesystem/dotgit/dotgit.go')
-rw-r--r--storage/filesystem/dotgit/dotgit.go50
1 files changed, 15 insertions, 35 deletions
diff --git a/storage/filesystem/dotgit/dotgit.go b/storage/filesystem/dotgit/dotgit.go
index 8c3896b..83c7683 100644
--- a/storage/filesystem/dotgit/dotgit.go
+++ b/storage/filesystem/dotgit/dotgit.go
@@ -21,17 +21,15 @@ import (
)
const (
- suffix = ".git"
- packedRefsPath = "packed-refs"
- localConfigPath = "config"
- globalConfigPath = ".gitconfig"
- systemConfigPath = "/etc/gitconfig"
- indexPath = "index"
- shallowPath = "shallow"
- modulePath = "modules"
- objectsPath = "objects"
- packPath = "pack"
- refsPath = "refs"
+ suffix = ".git"
+ packedRefsPath = "packed-refs"
+ configPath = "config"
+ indexPath = "index"
+ shallowPath = "shallow"
+ modulePath = "modules"
+ objectsPath = "objects"
+ packPath = "pack"
+ refsPath = "refs"
tmpPackedRefsPrefix = "._packed-refs"
@@ -157,32 +155,14 @@ func (d *DotGit) Close() error {
return nil
}
-// LocalConfigWriter returns a file pointer for write to the local config file
-func (d *DotGit) LocalConfigWriter() (billy.File, error) {
- return d.fs.Create(localConfigPath)
+// ConfigWriter returns a file pointer for write to the config file
+func (d *DotGit) ConfigWriter() (billy.File, error) {
+ return d.fs.Create(configPath)
}
-// LocalConfig returns a file pointer for read to the local config file
-func (d *DotGit) LocalConfig() (billy.File, error) {
- return d.fs.Open(localConfigPath)
-}
-
-// GlobalConfigWriter returns a file pointer for write to the global config file
-func (d *DotGit) GlobalConfigWriter() (billy.File, error) {
- return osfs.New(os.Getenv("HOME")).Create(globalConfigPath)
-}
-
-// GlobalConfig returns a file pointer for read to the global config file
-func (d *DotGit) GlobalConfig() (billy.File, error) {
- return osfs.New(os.Getenv("HOME")).Open(globalConfigPath)
-}
-
-// SystemConfigWriter doesn't exist because we typically do not have permission
-// to write to files in /etc.
-
-// SystemConfig returns a file pointer for read to the system config file
-func (d *DotGit) SystemConfig() (billy.File, error) {
- return osfs.New("/").Open(systemConfigPath)
+// Config returns a file pointer for read to the config file
+func (d *DotGit) Config() (billy.File, error) {
+ return d.fs.Open(configPath)
}
// IndexWriter returns a file pointer for write to the index file