Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit 14d9faa

Browse files
committed
config: add commentChar to core config struct
Signed-off-by: Zaq? Wiedmann <zaquestion@gmail.com>
1 parent 005d5dc commit 14d9faa

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

config/config.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,6 +40,9 @@ type Config struct {
4040
IsBare bool
4141
// Worktree is the path to the root of the working tree.
4242
Worktree string
43+
// CommentChar is the character indicating the start of a
44+
// comment for commands like commit and tag
45+
CommentChar string
4346
}
4447

4548
Pack struct {
@@ -113,6 +116,7 @@ const (
113116
urlKey = "url"
114117
bareKey = "bare"
115118
worktreeKey = "worktree"
119+
commentCharKey = "commentChar"
116120
windowKey = "window"
117121
mergeKey = "merge"
118122

@@ -151,6 +155,7 @@ func (c *Config) unmarshalCore() {
151155
}
152156

153157
c.Core.Worktree = s.Options.Get(worktreeKey)
158+
c.Core.CommentChar = s.Options.Get(commentCharKey)
154159
}
155160

156161
func (c *Config) unmarshalPack() error {

config/config_test.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) {
1313
input := []byte(`[core]
1414
bare = true
1515
worktree = foo
16+
commentchar = bar
1617
[pack]
1718
window = 20
1819
[remote "origin"]
@@ -38,6 +39,7 @@ func (s *ConfigSuite) TestUnmarshall(c *C) {
3839

3940
c.Assert(cfg.Core.IsBare, Equals, true)
4041
c.Assert(cfg.Core.Worktree, Equals, "foo")
42+
c.Assert(cfg.Core.CommentChar, Equals, "bar")
4143
c.Assert(cfg.Pack.Window, Equals, uint(20))
4244
c.Assert(cfg.Remotes, HasLen, 2)
4345
c.Assert(cfg.Remotes["origin"].Name, Equals, "origin")

0 commit comments

Comments
 (0)