1
0
Fork 0
forked from forgejo/forgejo

Fix typos in models/ and modules/ (#1248)

This commit is contained in:
Ethan Koenig 2017-03-14 20:52:01 -04:00 committed by Lunny Xiao
parent ec0ae5d50c
commit 021904e4e6
26 changed files with 63 additions and 63 deletions

View file

@ -57,7 +57,7 @@ func GetProtectedBranchBy(repoID int64, BranchName string) (*ProtectedBranch, er
return rel, nil
}
// GetProtectedBranches get all protected btanches
// GetProtectedBranches get all protected branches
func (repo *Repository) GetProtectedBranches() ([]*ProtectedBranch, error) {
protectedBranches := make([]*ProtectedBranch, 0)
return protectedBranches, x.Find(&protectedBranches, &ProtectedBranch{RepoID: repo.ID})

View file

@ -733,7 +733,7 @@ func (issue *Issue) ChangeContent(doer *User, content string) (err error) {
return nil
}
// ChangeAssignee changes the Asssignee field of this issue.
// ChangeAssignee changes the Assignee field of this issue.
func (issue *Issue) ChangeAssignee(doer *User, assigneeID int64) (err error) {
var oldAssigneeID = issue.AssigneeID
issue.AssigneeID = assigneeID

View file

@ -59,10 +59,10 @@ func (issues IssueList) loadPosters(e Engine) error {
return nil
}
postgerIDs := issues.getPosterIDs()
posterMaps := make(map[int64]*User, len(postgerIDs))
posterIDs := issues.getPosterIDs()
posterMaps := make(map[int64]*User, len(posterIDs))
err := e.
In("id", postgerIDs).
In("id", posterIDs).
Find(&posterMaps)
if err != nil {
return err

View file

@ -28,7 +28,7 @@ type UserV14 struct {
DiffViewStyle string `xorm:"NOT NULL DEFAULT ''"`
}
// TableName will be invoked by XORM to customrize the table name
// TableName will be invoked by XORM to customize the table name
func (*UserV14) TableName() string {
return "user"
}

View file

@ -117,15 +117,15 @@ func TestTeam_HasRepository(t *testing.T) {
func TestTeam_AddRepository(t *testing.T) {
assert.NoError(t, PrepareTestDatabase())
testSucess := func(teamID, repoID int64) {
testSuccess := func(teamID, repoID int64) {
team := AssertExistsAndLoadBean(t, &Team{ID: teamID}).(*Team)
repo := AssertExistsAndLoadBean(t, &Repository{ID: repoID}).(*Repository)
assert.NoError(t, team.AddRepository(repo))
AssertExistsAndLoadBean(t, &TeamRepo{TeamID: teamID, RepoID: repoID})
CheckConsistencyFor(t, &Team{ID: teamID}, &Repository{ID: repoID})
}
testSucess(2, 3)
testSucess(2, 5)
testSuccess(2, 3)
testSuccess(2, 5)
team := AssertExistsAndLoadBean(t, &Team{ID: 1}).(*Team)
repo := AssertExistsAndLoadBean(t, &Repository{ID: 1}).(*Repository)

View file

@ -73,7 +73,7 @@ func (r *Release) loadAttributes(e Engine) error {
return nil
}
// LoadAttributes load repo and publisher attributes for a realease
// LoadAttributes load repo and publisher attributes for a release
func (r *Release) LoadAttributes() error {
return r.loadAttributes(x)
}

View file

@ -541,7 +541,7 @@ func (u *User) GetOrgRepositoryIDs() ([]int64, error) {
GroupBy("repository.id").Find(&ids)
}
// GetAccessRepoIDs returns all repsitories IDs where user's or user is a team member orgnizations
// GetAccessRepoIDs returns all repositories IDs where user's or user is a team member organizations
func (u *User) GetAccessRepoIDs() ([]int64, error) {
ids, err := u.GetRepositoryIDs()
if err != nil {
@ -596,7 +596,7 @@ func (u *User) ShortName(length int) string {
return base.EllipsisString(u.Name, length)
}
// IsMailable checks if a user is elegible
// IsMailable checks if a user is eligible
// to receive emails.
func (u *User) IsMailable() bool {
return u.IsActive
@ -615,7 +615,7 @@ func IsUserExist(uid int64, name string) (bool, error) {
Get(&User{LowerName: strings.ToLower(name)})
}
// GetUserSalt returns a ramdom user salt token.
// GetUserSalt returns a random user salt token.
func GetUserSalt() (string, error) {
return base.GetRandomString(10)
}

View file

@ -475,11 +475,11 @@ func PrepareWebhooks(repo *Repository, event HookEventType, p api.Payloader) err
// check if repo belongs to org and append additional webhooks
if repo.MustOwner().IsOrganization() {
// get hooks for org
orgws, err := GetActiveWebhooksByOrgID(repo.OwnerID)
orgHooks, err := GetActiveWebhooksByOrgID(repo.OwnerID)
if err != nil {
return fmt.Errorf("GetActiveWebhooksByOrgID: %v", err)
}
ws = append(ws, orgws...)
ws = append(ws, orgHooks...)
}
if len(ws) == 0 {