Monorepo for Tangled tangled.org

appview/state: strip .git from repo name during creation

Signed-off-by: Anirudh Oppiliappan <anirudh@tangled.sh>

anirudh.fi eb67abe4 ce03b9db

verified
Changed files
+6
appview
state
+6
appview/state/state.go
··· 263 263 return nil 264 264 } 265 265 266 + func stripGitExt(name string) string { 267 + return strings.TrimSuffix(name, ".git") 268 + } 269 + 266 270 func (s *State) NewRepo(w http.ResponseWriter, r *http.Request) { 267 271 switch r.Method { 268 272 case http.MethodGet: ··· 297 301 s.pages.Notice(w, "repo", err.Error()) 298 302 return 299 303 } 304 + 305 + repoName = stripGitExt(repoName) 300 306 301 307 defaultBranch := r.FormValue("branch") 302 308 if defaultBranch == "" {