mirror of
https://github.com/aptly-dev/aptly.git
synced 2026-06-04 05:10:40 +00:00
Don't generate default comment for local repos.
This commit is contained in:
Vendored
+4
-4
@@ -23,9 +23,6 @@ type LocalRepo struct {
|
||||
|
||||
// NewLocalRepo creates new instance of Debian local repository
|
||||
func NewLocalRepo(name string, comment string) *LocalRepo {
|
||||
if comment == "" {
|
||||
comment = "local repo"
|
||||
}
|
||||
return &LocalRepo{
|
||||
UUID: uuid.New(),
|
||||
Name: name,
|
||||
@@ -35,7 +32,10 @@ func NewLocalRepo(name string, comment string) *LocalRepo {
|
||||
|
||||
// String interface
|
||||
func (repo *LocalRepo) String() string {
|
||||
return fmt.Sprintf("[%s]: %s", repo.Name, repo.Comment)
|
||||
if repo.Comment != "" {
|
||||
return fmt.Sprintf("[%s]: %s", repo.Name, repo.Comment)
|
||||
}
|
||||
return fmt.Sprintf("[%s]", repo.Name)
|
||||
}
|
||||
|
||||
// NumPackages return number of packages in local repo
|
||||
|
||||
Vendored
+1
-1
@@ -33,7 +33,7 @@ func (s *LocalRepoSuite) TearDownTest(c *C) {
|
||||
|
||||
func (s *LocalRepoSuite) TestString(c *C) {
|
||||
c.Check(NewLocalRepo("lrepo", "My first repo").String(), Equals, "[lrepo]: My first repo")
|
||||
c.Check(NewLocalRepo("lrepo2", "").String(), Equals, "[lrepo2]: local repo")
|
||||
c.Check(NewLocalRepo("lrepo2", "").String(), Equals, "[lrepo2]")
|
||||
}
|
||||
|
||||
func (s *LocalRepoSuite) TestNumPackages(c *C) {
|
||||
|
||||
Reference in New Issue
Block a user