From 1a026940999d759bf879769965fd1a3da2ec4903 Mon Sep 17 00:00:00 2001 From: "Guillaume J. Charmes" Date: Fri, 22 Mar 2013 17:58:00 -0700 Subject: [PATCH] Forbid users to push "root" repositories Upstream-commit: b370acd679622239849b1dfbe05d61804aeb7162 Component: engine --- components/engine/commands.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/components/engine/commands.go b/components/engine/commands.go index 0de3c77c39..14ebe47b58 100644 --- a/components/engine/commands.go +++ b/components/engine/commands.go @@ -420,7 +420,9 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string tmp := strings.SplitN(local, "/", 2) if len(tmp) == 1 { - remote = srv.runtime.authConfig.Username + "/" + local + return fmt.Errorf( + "Impossible to push a \"root\" repository. Please rename your repository in / (ex: %s/%s)", + srv.runtime.authConfig.Username, local) } else { remote = local }