Commit 6d8b897
Eric Bower
·
2023-08-10 09:24:09 -0400 EDT
parent 5b50e23
cleanup
1 files changed,
+14,
-10
M
main.go
M
main.go
+14,
-10
| ... | ... | @@ -73,7 +73,7 @@ type RevData struct { | |
| 73 | 73 | ||
| 74 | 74 | type TagData struct { | |
| 75 | 75 | Name string | |
| 76 | - | URL template.URL | |
| 76 | + | URL template.URL | |
| 77 | 77 | } | |
| 78 | 78 | ||
| 79 | 79 | type CommitData struct { |
| ... | ... | @@ -82,7 +82,7 @@ type CommitData struct { | |
| 82 | 82 | WhenStr string | |
| 83 | 83 | AuthorStr string | |
| 84 | 84 | ShortID string | |
| 85 | - | Refs []*RefInfo | |
| 85 | + | Refs []*RefInfo | |
| 86 | 86 | *git.Commit | |
| 87 | 87 | } | |
| 88 | 88 |
| ... | ... | @@ -117,7 +117,7 @@ type DiffRenderFile struct { | |
| 117 | 117 | } | |
| 118 | 118 | ||
| 119 | 119 | type RefInfo struct { | |
| 120 | - | ID string | |
| 120 | + | ID string | |
| 121 | 121 | Refspec string | |
| 122 | 122 | URL template.URL | |
| 123 | 123 | } |
| ... | ... | @@ -577,7 +577,7 @@ func (c *Config) writeRepo() *BranchOutput { | |
| 577 | 577 | claimed := false | |
| 578 | 578 | for _, revData := range revs { | |
| 579 | 579 | refInfoMap[revData.RevName] = &RefInfo{ | |
| 580 | - | ID: revData.ID, | |
| 580 | + | ID: revData.ID, | |
| 581 | 581 | Refspec: revData.RevName, | |
| 582 | 582 | URL: revData.TreeURL, | |
| 583 | 583 | } |
| ... | ... | @@ -592,7 +592,7 @@ func (c *Config) writeRepo() *BranchOutput { | |
| 592 | 592 | } | |
| 593 | 593 | ||
| 594 | 594 | refInfoMap[refspec] = &RefInfo{ | |
| 595 | - | ID: ref.ID, | |
| 595 | + | ID: ref.ID, | |
| 596 | 596 | Refspec: refspec, | |
| 597 | 597 | } | |
| 598 | 598 | } |
| ... | ... | @@ -614,13 +614,13 @@ func (c *Config) writeRepo() *BranchOutput { | |
| 614 | 614 | }) | |
| 615 | 615 | ||
| 616 | 616 | for _, revData := range revs { | |
| 617 | - | data := &PageData{ | |
| 617 | + | data := &PageData{ | |
| 618 | 618 | Repo: c, | |
| 619 | 619 | RevData: revData, | |
| 620 | 620 | SiteURLs: c.getURLs(), | |
| 621 | 621 | } | |
| 622 | 622 | ||
| 623 | - | branchOutput := c.writeBranch(repo, data, refInfoList) | |
| 623 | + | branchOutput := c.writeRevision(repo, data, refInfoList) | |
| 624 | 624 | if !claimed { | |
| 625 | 625 | mainOutput = branchOutput | |
| 626 | 626 | claimed = true |
| ... | ... | @@ -645,8 +645,12 @@ func (c *Config) writeRepo() *BranchOutput { | |
| 645 | 645 | return mainOutput | |
| 646 | 646 | } | |
| 647 | 647 | ||
| 648 | - | func (c *Config) writeBranch(repo *git.Repository, pageData *PageData, refs []*RefInfo) *BranchOutput { | |
| 649 | - | fmt.Printf("compiling (%s) branch (%s)\n", c.RepoName, pageData.RevData.RevName) | |
| 648 | + | func (c *Config) writeRevision(repo *git.Repository, pageData *PageData, refs []*RefInfo) *BranchOutput { | |
| 649 | + | c.Logger.Infof( | |
| 650 | + | "compiling (%s) revision (%s)", | |
| 651 | + | c.RepoName, | |
| 652 | + | pageData.RevData.RevName, | |
| 653 | + | ) | |
| 650 | 654 | ||
| 651 | 655 | output := &BranchOutput{} | |
| 652 | 656 | pageSize := pageData.Repo.MaxCommits |