Documentation ¶
Index ¶
- func CleanUpMigrateInfo(repo *models.Repository) (*models.Repository, error)
- func CreateDelegateHooks(repoPath string) error
- func CreateNewBranch(doer *models.User, repo *models.Repository, oldBranchName, branchName string) (err error)
- func CreateNewBranchFromCommit(doer *models.User, repo *models.Repository, commit, branchName string) (err error)
- func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *models.Repository, err error)
- func DeleteMissingRepositories(doer *models.User) error
- func ForkRepository(doer, owner *models.User, oldRepo *models.Repository, name, desc string) (_ *models.Repository, err error)
- func GenerateGitContent(ctx models.DBContext, templateRepo, generateRepo *models.Repository) error
- func GenerateRepository(ctx models.DBContext, doer, owner *models.User, ...) (_ *models.Repository, err error)
- func GetBranch(repo *models.Repository, branch string) (*git.Branch, error)
- func GetBranches(repo *models.Repository) ([]*git.Branch, error)
- func GitFsck(ctx context.Context) error
- func GitGcRepos(ctx context.Context) error
- func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opts api.MigrateRepoOption) (*models.Repository, error)
- func PushUpdateAddTag(repo *models.Repository, gitRepo *git.Repository, tagName string) error
- func ReinitMissingRepositories() error
- func SyncReleasesWithTags(repo *models.Repository, gitRepo *git.Repository) error
- func SyncRepositoryHooks(ctx context.Context) error
- type PushCommit
- type PushCommits
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CleanUpMigrateInfo ¶
func CleanUpMigrateInfo(repo *models.Repository) (*models.Repository, error)
CleanUpMigrateInfo finishes migrating repository and/or wiki with things that don't need to be done for mirrors.
func CreateDelegateHooks ¶
CreateDelegateHooks creates all the hooks scripts for the repo
func CreateNewBranch ¶
func CreateNewBranch(doer *models.User, repo *models.Repository, oldBranchName, branchName string) (err error)
CreateNewBranch creates a new repository branch
func CreateNewBranchFromCommit ¶
func CreateNewBranchFromCommit(doer *models.User, repo *models.Repository, commit, branchName string) (err error)
CreateNewBranchFromCommit creates a new repository branch
func CreateRepository ¶
func CreateRepository(doer, u *models.User, opts models.CreateRepoOptions) (_ *models.Repository, err error)
CreateRepository creates a repository for the user/organization.
func DeleteMissingRepositories ¶
DeleteMissingRepositories deletes all repository records that lost Git files.
func ForkRepository ¶
func ForkRepository(doer, owner *models.User, oldRepo *models.Repository, name, desc string) (_ *models.Repository, err error)
ForkRepository forks a repository
func GenerateGitContent ¶
func GenerateGitContent(ctx models.DBContext, templateRepo, generateRepo *models.Repository) error
GenerateGitContent generates git content from a template repository
func GenerateRepository ¶
func GenerateRepository(ctx models.DBContext, doer, owner *models.User, templateRepo *models.Repository, opts models.GenerateRepoOptions) (_ *models.Repository, err error)
GenerateRepository generates a repository from a template
func GetBranches ¶
func GetBranches(repo *models.Repository) ([]*git.Branch, error)
GetBranches returns all the branches of a repository
func GitGcRepos ¶
GitGcRepos calls 'git gc' to remove unnecessary files and optimize the local repository
func MigrateRepositoryGitData ¶
func MigrateRepositoryGitData(doer, u *models.User, repo *models.Repository, opts api.MigrateRepoOption) (*models.Repository, error)
MigrateRepositoryGitData starts migrating git related data after created migrating repository
func PushUpdateAddTag ¶
func PushUpdateAddTag(repo *models.Repository, gitRepo *git.Repository, tagName string) error
PushUpdateAddTag must be called for any push actions to add tag
func ReinitMissingRepositories ¶
func ReinitMissingRepositories() error
ReinitMissingRepositories reinitializes all repository records that lost Git files.
func SyncReleasesWithTags ¶
func SyncReleasesWithTags(repo *models.Repository, gitRepo *git.Repository) error
SyncReleasesWithTags synchronizes release table with repository tags
func SyncRepositoryHooks ¶
SyncRepositoryHooks rewrites all repositories' pre-receive, update and post-receive hooks to make sure the binary and custom conf path are up-to-date.
Types ¶
type PushCommit ¶
type PushCommit struct { Sha1 string Message string AuthorEmail string AuthorName string CommitterEmail string CommitterName string Timestamp time.Time }
PushCommit represents a commit in a push operation.
func CommitToPushCommit ¶
func CommitToPushCommit(commit *git.Commit) *PushCommit
CommitToPushCommit transforms a git.Commit to PushCommit type.
type PushCommits ¶
type PushCommits struct { Len int Commits []*PushCommit CompareURL string // contains filtered or unexported fields }
PushCommits represents list of commits in a push operation.
func ListToPushCommits ¶
func ListToPushCommits(l *list.List) *PushCommits
ListToPushCommits transforms a list.List to PushCommits type.
func NewPushCommits ¶
func NewPushCommits() *PushCommits
NewPushCommits creates a new PushCommits object.
func (*PushCommits) AvatarLink ¶
func (pc *PushCommits) AvatarLink(email string) string
AvatarLink tries to match user in database with e-mail in order to show custom avatar, and falls back to general avatar link.
func (*PushCommits) ToAPIPayloadCommits ¶
func (pc *PushCommits) ToAPIPayloadCommits(repoPath, repoLink string) ([]*api.PayloadCommit, error)
ToAPIPayloadCommits converts a PushCommits object to api.PayloadCommit format.