gtx


Branch: develop

Author
Spike Lindsey <spike01@gmail.com>
Date
Jan. 31 '23 00:39:01
Commit
16415ed22e7decb39f9be0b102427ae22f07aed4
Parent
696f49eb28916021071002241dfc33620bcc96c1
Changes
diff --git a/main.go b/main.go
index 81f5faa..692ae42 100644
--- a/main.go
+++ b/main.go
@@ -187,20 +187,19 @@ func main() {
 		log.Fatalf("unable to set up repo: %v", err)
 	}
 
-	branches, err := pro.branchfilter(opt.Branches)
-
-	if err != nil {
-		log.Fatalf("unable to filter branches: %v", err)
-	}
-
 	t := template.Must(template.New("page").Funcs(template.FuncMap{
 		"diffstatbodyparser": diffstatbodyparser,
 		"diffbodyparser":     diffbodyparser,
 	}).Parse(tpl))
 
+	branches, err := pro.branchfilter(opt.Branches)
+	if err != nil {
+		log.Fatalf("unable to filter branches: %v", err)
+	}
+
 	updateBranches(branches, pro)
 	writePages(branches, pro, t)
-	writeMainIndex(pro, opt, t, branches)
+	writeMainIndex(branches, pro, t, opt)
 }
 
 func updateBranches(branches []branch, pro *project) {
@@ -220,7 +219,6 @@ func updateBranches(branches []branch, pro *project) {
 	}
 }
 
-
 func writePages(branches []branch, pro *project, t *template.Template) {
 	for _, b := range branches {
 		log.Printf("processing branch: %s", b)
@@ -263,7 +261,7 @@ func writePages(branches []branch, pro *project, t *template.Template) {
 	}
 }
 
-func writeMainIndex(pro *project, opt *options, t *template.Template, branches []branch) {
+func writeMainIndex(branches []branch, pro *project, t *template.Template, opt *options) {
 	// This is the main index or project home.
 	f, err := os.Create(filepath.Join(pro.base, "index.html"))