@ -160,7 +160,7 @@ func Search(ctx *context.APIContext) {
opts . Collaborate = util . OptionalBoolFalse
}
var mode = ctx . FormString ( "mode" )
mode : = ctx . FormString ( "mode" )
switch mode {
case "source" :
opts . Fork = util . OptionalBoolFalse
@ -186,9 +186,9 @@ func Search(ctx *context.APIContext) {
opts . IsPrivate = util . OptionalBoolOf ( ctx . FormBool ( "is_private" ) )
}
var sortMode = ctx . FormString ( "sort" )
sortMode : = ctx . FormString ( "sort" )
if len ( sortMode ) > 0 {
var sortOrder = ctx . FormString ( "order" )
sortOrder : = ctx . FormString ( "order" )
if len ( sortOrder ) == 0 {
sortOrder = "asc"
}
@ -264,7 +264,8 @@ func CreateUserRepo(ctx *context.APIContext, owner *user_model.User, opt api.Cre
if repo_model . IsErrRepoAlreadyExist ( err ) {
ctx . Error ( http . StatusConflict , "" , "The repository with the same name already exists." )
} else if db . IsErrNameReserved ( err ) ||
db . IsErrNamePatternNotAllowed ( err ) {
db . IsErrNamePatternNotAllowed ( err ) ||
models . IsErrIssueLabelTemplateLoad ( err ) {
ctx . Error ( http . StatusUnprocessableEntity , "" , err )
} else {
ctx . Error ( http . StatusInternalServerError , "CreateRepository" , err )