diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-08-30 13:03:47 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-08-30 13:03:47 +0200 |
commit | 7f42492cdeffaf2127e4050b1456f1f0b13f9bbd (patch) | |
tree | ef63ad56a654b9c5b14d7d31e99103105be1a443 /config | |
parent | 34b101e3e2e4c7de728f9d149ef9bf1ae298a9b3 (diff) | |
parent | 14d9faa61e2d38d31593c8536121d814947240fc (diff) | |
download | go-git-7f42492cdeffaf2127e4050b1456f1f0b13f9bbd.tar.gz |
Merge pull request #937 from zaquestion/comment_char
config: add commentChar to core config struct
Diffstat (limited to 'config')
-rw-r--r-- | config/config.go | 5 | ||||
-rw-r--r-- | config/config_test.go | 2 |
2 files changed, 7 insertions, 0 deletions
diff --git a/config/config.go b/config/config.go index ce6506d..a637f6d 100644 --- a/config/config.go +++ b/config/config.go @@ -40,6 +40,9 @@ type Config struct { IsBare bool // Worktree is the path to the root of the working tree. Worktree string + // CommentChar is the character indicating the start of a + // comment for commands like commit and tag + CommentChar string } Pack struct { @@ -113,6 +116,7 @@ const ( urlKey = "url" bareKey = "bare" worktreeKey = "worktree" + commentCharKey = "commentChar" windowKey = "window" mergeKey = "merge" @@ -151,6 +155,7 @@ func (c *Config) unmarshalCore() { } c.Core.Worktree = s.Options.Get(worktreeKey) + c.Core.CommentChar = s.Options.Get(commentCharKey) } func (c *Config) unmarshalPack() error { diff --git a/config/config_test.go b/config/config_test.go index 5cd713e..fe73de8 100644 --- a/config/config_test.go +++ b/config/config_test.go @@ -13,6 +13,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) { input := []byte(`[core] bare = true worktree = foo + commentchar = bar [pack] window = 20 [remote "origin"] @@ -38,6 +39,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) { c.Assert(cfg.Core.IsBare, Equals, true) c.Assert(cfg.Core.Worktree, Equals, "foo") + c.Assert(cfg.Core.CommentChar, Equals, "bar") c.Assert(cfg.Pack.Window, Equals, uint(20)) c.Assert(cfg.Remotes, HasLen, 2) c.Assert(cfg.Remotes["origin"].Name, Equals, "origin") |