shithub: furgit

Download patch

ref: 6cff7528ae38a286fb56978a8d8f283ef342dfcb
parent: 101fe6a0d74543bab7cb9876e3bea1f2d21a592a
author: Runxi Yu <runxiyu@umich.edu>
date: Sun Mar 29 09:30:29 EDT 2026

cmd/receivepack9418: Remove the silly runMain thingy

--- a/cmd/receivepack9418/main.go
+++ b/cmd/receivepack9418/main.go
@@ -8,10 +8,6 @@
 )
 
 func main() {
-	os.Exit(runMain())
-}
-
-func runMain() int {
 	listenAddr := flag.String("listen", ":9418", "listen address")
 	repoPath := flag.String("repo", "", "path to git dir (.git or bare repo root)")
 	cpuProfilePath := flag.String("cpuprofile", "", "write CPU profile to file")
@@ -22,7 +18,7 @@
 	if *repoPath == "" {
 		log.Print("must provide -repo <path-to-git-dir>")
 
-		return 2
+		os.Exit(2)
 	}
 
 	if *cpuProfilePath != "" {
@@ -30,7 +26,7 @@
 		if err != nil {
 			log.Printf("cpuprofile: %v", err)
 
-			return 1
+			os.Exit(1)
 		}
 
 		defer func() {
@@ -54,8 +50,8 @@
 	if err != nil {
 		log.Printf("run: %v", err)
 
-		return 1
+		os.Exit(1)
 	}
 
-	return 0
+	os.Exit(0)
 }
--