Skip to content

Commit

Permalink
Allow empty lines in package list
Browse files Browse the repository at this point in the history
  • Loading branch information
cskr committed Jul 26, 2012
1 parent ab85ba6 commit fd6269d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 2 deletions.
7 changes: 5 additions & 2 deletions gorepos.go
Expand Up @@ -103,8 +103,11 @@ func (pl *PackageList) loadPackages() error {
return err
}

pkg := NewPackage(string(ln))
pkgs[pkg.Path] = pkg
line := string(ln)
if len(strings.TrimSpace(line)) > 0 {
pkg := NewPackage(line)
pkgs[pkg.Path] = pkg
}
}
pl.packages = pkgs

Expand Down
1 change: 1 addition & 0 deletions gorepos_test.go
Expand Up @@ -129,6 +129,7 @@ func generateList() (fname string, err error) {

fmt.Fprintln(f, "/lib1 git ssh://git@bitbucket.org/user1/lib1")
fmt.Fprintln(f, "/lib2 hg ssh://hg@bitbucket.org/user2/lib2")
fmt.Fprintln(f, " ")
fmt.Fprintln(f, "/lib3 git ssh://git@go.mydomain.com/lib3")
return fname, nil
}
Expand Down

0 comments on commit fd6269d

Please sign in to comment.