新增:分支查询删除分支与普通分支
This commit is contained in:
parent
cf8779216a
commit
8f0e78026d
|
|
@ -35,11 +35,20 @@ func ListBranches(ctx *context.APIContext) {
|
|||
ctx.Error(http.StatusInternalServerError, "Load git repository failed", nil)
|
||||
return
|
||||
}
|
||||
var isDeleted util.OptionalBool
|
||||
switch ctx.FormString("state") {
|
||||
case "all":
|
||||
isDeleted = util.OptionalBoolNone
|
||||
case "deleted":
|
||||
isDeleted = util.OptionalBoolTrue
|
||||
default:
|
||||
isDeleted = util.OptionalBoolFalse
|
||||
}
|
||||
|
||||
branchOpts := git_model.FindBranchOptions{
|
||||
ListOptions: listOptions,
|
||||
RepoID: ctx.Repo.Repository.ID,
|
||||
IsDeletedBranch: util.OptionalBoolNone,
|
||||
IsDeletedBranch: isDeleted,
|
||||
Keyword: searchName,
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue