this repo has no description

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

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

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