# Functions
AddDeletedBranch adds a deleted branch to the database.
CalcCommitStatus returns commit status state via some status, the commit statues should order by id desc.
CheckLFSAccessForRepo check needed access mode base on action.
CommitStatusesHideActionsURL hide Gitea Actions urls.
ConvertFromGitCommit converts git commits into SignCommitWithStatuses.
CopyLFS copies LFS data from one repo to another.
CountLFSLockByRepoID returns a count of all LFSLocks associated with a repository.
CountLFSMetaObjects returns a count of all LFSMetaObjects associated with a repository.
CreateLFSLock creates a new lock.
DeleteLFSLockByID deletes a lock by given ID.
DeleteProtectedBranch removes ProtectedBranch relation between the user and repository.
DeleteProtectedTag deletes a protected tag by ID.
ExistsLFSObject checks if a provided Oid exists within the DB.
FindAllMatchedBranches find all matched branches.
FindRecentlyPushedNewBranches return at most 2 new branches pushed by the user in 2 hours which has no opened PRs created if opts.CommitAfterUnix is 0, we will find the branches that were committed to in the last 2 hours if opts.ListOptions is not set, we will only display top 2 latest branches.
FindRenamedBranch check if a branch was renamed.
FindRepoProtectedBranchRules load all repository's protected rules.
FindRepoRecentCommitStatusContexts returns repository's recent commit status contexts.
GetFirstMatchProtectedBranchRule returns the first matched rules.
GetLatestCommitStatus returns all statuses with a unique context for a given commit.
GetLatestCommitStatusForPairs returns all statuses with a unique context for a given list of repo-sha pairs.
GetLatestCommitStatusForRepoCommitIDs returns all statuses with a unique context for a given list of repo-sha pairs.
GetLFSLock returns release by given path.
GetLFSLockByID returns release by given id.
GetLFSLockByRepoID returns a list of locks of repository.
GetLFSMetaObjectByOid selects a LFSMetaObject entry from database by its OID.
GetLFSMetaObjects returns all LFSMetaObjects associated with a repository.
GetNextCommitStatusIndex retried 3 times to generate a resource index.
GetProtectedBranchRuleByID getting protected branch rule by rule ID.
GetProtectedBranchRuleByName getting protected branch rule by name.
GetProtectedTagByID gets the protected tag with the specific id.
GetProtectedTagByNamePattern gets protected tag by name_pattern.
GetProtectedTags gets all protected tags of the repository.
GetRepoLFSSize return a repository's lfs files size.
GetTreePathLock returns LSF lock for the treePath.
InsertProtectedTag inserts a protected tag to database.
IsBranchProtected checks if branch is protected.
IsErrBranchAlreadyExists checks if an error is an ErrBranchAlreadyExists.
IsErrBranchesEqual checks if an error is an ErrBranchesEqual.
IsErrBranchNameConflict checks if an error is an ErrBranchNameConflict.
IsErrBranchNotExist checks if an error is an ErrBranchDoesNotExist.
IsErrLFSFileLocked checks if an error is a ErrLFSFileLocked.
IsErrLFSLockAlreadyExist checks if an error is a ErrLFSLockAlreadyExist.
IsErrLFSLockNotExist checks if an error is a ErrLFSLockNotExist.
IsErrLFSUnauthorizedAction checks if an error is a ErrLFSUnauthorizedAction.
IsRuleNameSpecial return true if it contains special character.
IsUserAllowedModifyTag returns true if the user is allowed to modify the tag.
IsUserAllowedToControlTag checks if a user can control the specific tag.
IsUserMergeWhitelisted checks if some user is whitelisted to merge to this branch.
IsUserOfficialReviewer check if user is official reviewer for the branch (counts towards required approvals).
IterateLFSMetaObjectsForRepo provides a iterator for LFSMetaObjects per Repo.
IterateRepositoryIDsWithLFSMetaObjects iterates across the repositories that have LFSMetaObjects.
LFSAutoAssociate auto associates accessible LFSMetaObjects.
LFSObjectAccessible checks if a provided Oid is accessible to the user.
MarkLFSMetaObject updates the updated time for the provided LFSMetaObject.
NewCommitStatus save commit statuses into database.
NewLFSMetaObject stores a given populated LFSMetaObject structure in the database if it is not already present.
ParseCommitsWithStatus checks commits latest statuses and calculates its worst status state.
RemoveLFSMetaObjectByOid removes a LFSMetaObject entry from database by its OID.
RemoveLFSMetaObjectByOidFn removes a LFSMetaObject entry from database by its OID.
RemoveOldDeletedBranches removes old deleted branches.
RemoveTeamIDFromProtectedBranch removes all team ids from protected branch options.
RemoveUserIDFromProtectedBranch removes all user ids from protected branch options.
RenameBranch rename a branch.
UpdateBranch updates the branch information in the database.
UpdateProtectBranch saves branch protection options of repository.
UpdateProtectedTag updates the protected tag.
# Variables
ErrLFSObjectNotExist is returned from lfs models functions in order to differentiate between database and missing object errors.
# Structs
Branch represents a branch of a repository For those repository who have many branches, stored into database is a good choice for pagination, keyword search and filtering.
CommitStatus holds a single Status of a single Commit.
CommitStatusIndex represents a table for commit status index.
CommitStatusOptions holds the options for query commit statuses.
CommitStatusSummary holds the latest commit Status of a single Commit.
ErrBranchAlreadyExists represents an error that branch with such name already exists.
ErrBranchesEqual represents an error that base branch is equal to the head branch.
ErrBranchNameConflict represents an error that branch name conflicts with other branch.
ErrBranchNotExist represents an error that branch with such name does not exist.
ErrLFSFileLocked represents a "LFSFileLocked" kind of error.
ErrLFSLockAlreadyExist represents a "LFSLockAlreadyExist" kind of error.
ErrLFSLockNotExist represents a "LFSLockNotExist" kind of error.
ErrLFSUnauthorizedAction represents a "LFSUnauthorizedAction" kind of error.
IterateLFSMetaObjectsForRepoOptions provides options for IterateLFSMetaObjectsForRepo.
LFSLock represents a git lfs lock of repository.
LFSMetaObject stores metadata for LFS tracked files.
LFSTokenResponse defines the JSON structure in which the JWT token is stored.
NewCommitStatusOptions holds options for creating a CommitStatus.
ProtectedBranch struct.
ProtectedTag struct.
RenamedBranch provide renamed branch log will check it when a branch can't be found.
SignCommitWithStatuses represents a commit with validation of signature and status state.
WhitelistOptions represent all sorts of whitelists used for protected branches.