浏览代码

Merge branch 'no_root_repo_push'

Guillaume J. Charmes 12 年之前
父节点
当前提交
bd2a55cd26
共有 1 个文件被更改,包括 3 次插入1 次删除
  1. 3 1
      commands.go

+ 3 - 1
commands.go

@@ -420,7 +420,9 @@ func (srv *Server) CmdPush(stdin io.ReadCloser, stdout io.Writer, args ...string
 
 
 	tmp := strings.SplitN(local, "/", 2)
 	tmp := strings.SplitN(local, "/", 2)
 	if len(tmp) == 1 {
 	if len(tmp) == 1 {
-		remote = srv.runtime.authConfig.Username + "/" + local
+		return fmt.Errorf(
+			"Impossible to push a \"root\" repository. Please rename your repository in <user>/<repo> (ex: %s/%s)",
+			srv.runtime.authConfig.Username, local)
 	} else {
 	} else {
 		remote = local
 		remote = local
 	}
 	}