fork of go-git with some jj specific features
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

add some tests

+27
+27
config/config_test.go
··· 4 4 "io/ioutil" 5 5 "os" 6 6 "path/filepath" 7 + "strings" 7 8 8 9 "github.com/go-git/go-git/v5/plumbing" 9 10 . "gopkg.in/check.v1" ··· 321 322 c.Assert(config.Raw, NotNil) 322 323 c.Assert(config.Pack.Window, Equals, DefaultPackWindow) 323 324 } 325 + 326 + func (s *ConfigSuite) TestLoadConfigLocalScope(c *C) { 327 + cfg, err := LoadConfig(LocalScope) 328 + c.Assert(err, NotNil) 329 + c.Assert(cfg, IsNil) 330 + } 331 + 332 + func (s *ConfigSuite) TestRemoveUrlOptions(c *C) { 333 + buf := []byte(` 334 + [remote "alt"] 335 + url = git@github.com:mcuadros/go-git.git 336 + url = git@github.com:src-d/go-git.git 337 + fetch = +refs/heads/*:refs/remotes/origin/* 338 + fetch = +refs/pull/*:refs/remotes/origin/pull/*`) 339 + 340 + cfg := NewConfig() 341 + err := cfg.Unmarshal(buf) 342 + c.Assert(err, IsNil) 343 + c.Assert(len(cfg.Remotes), Equals, 1) 344 + cfg.Remotes["alt"].URLs = []string{} 345 + 346 + buf, err = cfg.Marshal() 347 + if strings.Contains(string(buf), "url") { 348 + c.Fatal("conifg should not contain any url sections") 349 + } 350 + }