aboutsummaryrefslogtreecommitdiffstats
path: root/plumbing
diff options
context:
space:
mode:
Diffstat (limited to 'plumbing')
-rw-r--r--plumbing/format/config/encoder.go8
-rw-r--r--plumbing/transport/git/receive_pack_test.go4
-rw-r--r--plumbing/transport/server/loader.go2
3 files changed, 11 insertions, 3 deletions
diff --git a/plumbing/format/config/encoder.go b/plumbing/format/config/encoder.go
index 88bdf65..6d17a5a 100644
--- a/plumbing/format/config/encoder.go
+++ b/plumbing/format/config/encoder.go
@@ -3,6 +3,7 @@ package config
import (
"fmt"
"io"
+ "strings"
)
// An Encoder writes config files to an output stream.
@@ -61,7 +62,12 @@ func (e *Encoder) encodeSubsection(sectionName string, s *Subsection) error {
func (e *Encoder) encodeOptions(opts Options) error {
for _, o := range opts {
- if err := e.printf("\t%s = %s\n", o.Key, o.Value); err != nil {
+ pattern := "\t%s = %s\n"
+ if strings.Index(o.Value, "\\") != -1 {
+ pattern = "\t%s = %q\n"
+ }
+
+ if err := e.printf(pattern, o.Key, o.Value); err != nil {
return err
}
}
diff --git a/plumbing/transport/git/receive_pack_test.go b/plumbing/transport/git/receive_pack_test.go
index 326ef1b..f9afede 100644
--- a/plumbing/transport/git/receive_pack_test.go
+++ b/plumbing/transport/git/receive_pack_test.go
@@ -99,9 +99,11 @@ func (s *ReceivePackSuite) SetUpTest(c *C) {
}
func (s *ReceivePackSuite) TearDownTest(c *C) {
- err := s.daemon.Process.Signal(os.Interrupt)
+ err := s.daemon.Process.Signal(os.Kill)
c.Assert(err, IsNil)
+
_ = s.daemon.Wait()
+
err = os.RemoveAll(s.base)
c.Assert(err, IsNil)
}
diff --git a/plumbing/transport/server/loader.go b/plumbing/transport/server/loader.go
index d4eccd4..028ead4 100644
--- a/plumbing/transport/server/loader.go
+++ b/plumbing/transport/server/loader.go
@@ -10,7 +10,7 @@ import (
)
// DefaultLoader is a filesystem loader ignoring host and resolving paths to /.
-var DefaultLoader = NewFilesystemLoader(osfs.New("/"))
+var DefaultLoader = NewFilesystemLoader(osfs.New(""))
// Loader loads repository's storer.Storer based on an optional host and a path.
type Loader interface {