return nil
}
+func (c *Configuration) SetValidPushRemote(name string) error {
+ if err := git.ValidateRemote(name); err != nil {
+ return err
+ }
+ c.SetPushRemote(name)
+ return nil
+}
+
func (c *Configuration) SetRemote(name string) {
c.currentRemote = &name
}
+func (c *Configuration) SetPushRemote(name string) {
+ c.pushRemote = &name
+}
+
func (c *Configuration) Remotes() []string {
c.loadGitConfig()
return c.remotes
if err != nil {
errMsg := err.Error()
tracerx.Printf("Error running 'git rev-parse': %s", errMsg)
- if !strings.Contains(errMsg, "Not a git repository") {
+ if !strings.Contains(strings.ToLower(errMsg),
+ "not a git repository") {
fmt.Fprintf(os.Stderr, "Error: %s\n", errMsg)
}
c.gitDir = &gitdir
return c.Filesystem().GitStorageDir
}
-func (c *Configuration) LocalReferenceDir() string {
- return c.Filesystem().ReferenceDir
+func (c *Configuration) LocalReferenceDirs() []string {
+ return c.Filesystem().ReferenceDirs
}
func (c *Configuration) LFSStorageDir() string {
if c.fs == nil {
lfsdir, _ := c.Git.Get("lfs.storage")
- c.fs = fs.New(c.LocalGitDir(), c.LocalWorkingDir(), lfsdir)
+ c.fs = fs.New(
+ c.Os,
+ c.LocalGitDir(),
+ c.LocalWorkingDir(),
+ lfsdir,
+ )
}
return c.fs