This repository was archived by the owner on Sep 11, 2020. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Expand file tree Collapse file tree 2 files changed +7
-0
lines changed Original file line number Diff line number Diff 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
156161func (c * Config ) unmarshalPack () error {
Original file line number Diff line number Diff 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" )
You can’t perform that action at this time.
0 commit comments