Skip to content

Commit b370acd

Browse files
committed
Forbid users to push "root" repositories
1 parent 5c04d34 commit b370acd

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

commands.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -420,7 +420,9 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string
420420

421421
tmp := strings.SplitN(local, "/", 2)
422422
if len(tmp) == 1 {
423-
remote = srv.runtime.authConfig.Username + "/" + local
423+
return fmt.Errorf(
424+
"Impossible to push a \"root\" repository. Please rename your repository in <user>/<repo> (ex: %s/%s)",
425+
srv.runtime.authConfig.Username, local)
424426
} else {
425427
remote = local
426428
}

0 commit comments

Comments
 (0)