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