Backport: Fix lint, fmt and integration testing errors (#2553)

* Fix lint errors

* Fix fmt errors (#2544)

* Hotfix for integration testing (#2473)

* Hotfix for integration testing
This commit is contained in:
Ethan Koenig 2017-09-20 09:30:20 -07:00 committed by Lauris BH
parent d14a724b53
commit f014e42a06
13 changed files with 12 additions and 49 deletions

View file

@ -3,7 +3,7 @@ RUN_MODE = prod
[database] [database]
DB_TYPE = mysql DB_TYPE = mysql
HOST = 127.0.0.1:3306 HOST = mysql:3306
NAME = testgitea NAME = testgitea
USER = root USER = root
PASSWD = PASSWD =

View file

@ -3,7 +3,7 @@ RUN_MODE = prod
[database] [database]
DB_TYPE = postgres DB_TYPE = postgres
HOST = 127.0.0.1:5432 HOST = pgsql:5432
NAME = testgitea NAME = testgitea
USER = postgres USER = postgres
PASSWD = postgres PASSWD = postgres

View file

@ -3,11 +3,6 @@ RUN_MODE = prod
[database] [database]
DB_TYPE = sqlite3 DB_TYPE = sqlite3
HOST = 127.0.0.1:3306
NAME = testgitea
USER = gitea
PASSWD =
SSL_MODE = disable
PATH = :memory: PATH = :memory:
[repository] [repository]

View file

@ -276,11 +276,7 @@ func DeleteGPGKey(doer *User, id int64) (err error) {
return err return err
} }
if err = sess.Commit(); err != nil { return sess.Commit()
return err
}
return nil
} }
// CommitVerification represents a commit validation of signature // CommitVerification represents a commit validation of signature

View file

@ -572,11 +572,7 @@ func (issue *Issue) ReadBy(userID int64) error {
return err return err
} }
if err := setNotificationStatusReadIfUnread(x, userID, issue.ID); err != nil { return setNotificationStatusReadIfUnread(x, userID, issue.ID)
return err
}
return nil
} }
func updateIssueCols(e Engine, issue *Issue, cols ...string) error { func updateIssueCols(e Engine, issue *Issue, cols ...string) error {

View file

@ -509,10 +509,7 @@ func SMTPAuth(a smtp.Auth, cfg *SMTPConfig) error {
} }
if ok, _ := c.Extension("AUTH"); ok { if ok, _ := c.Extension("AUTH"); ok {
if err = c.Auth(a); err != nil { return c.Auth(a)
return err
}
return nil
} }
return ErrUnsupportedLoginType return ErrUnsupportedLoginType
} }

View file

@ -119,9 +119,5 @@ func addUnitsToTables(x *xorm.Engine) error {
} }
} }
if err := sess.Commit(); err != nil { return sess.Commit()
return err
}
return nil
} }

View file

@ -51,8 +51,5 @@ func useNewPublickeyFormat(x *xorm.Engine) error {
} }
f.Close() f.Close()
if err = os.Rename(tmpPath, fpath); err != nil { return os.Rename(tmpPath, fpath)
return err
}
return nil
} }

View file

@ -235,11 +235,7 @@ func DeleteOrganization(org *User) (err error) {
} }
} }
if err = sess.Commit(); err != nil { return sess.Commit()
return err
}
return nil
} }
func deleteOrg(e *xorm.Session, u *User) error { func deleteOrg(e *xorm.Session, u *User) error {

View file

@ -609,11 +609,7 @@ func RewriteAllPublicKeys() error {
defer f.Close() defer f.Close()
} }
if err = os.Rename(tmpPath, fPath); err != nil { return os.Rename(tmpPath, fPath)
return err
}
return nil
} }
// ________ .__ ____ __. // ________ .__ ____ __.

View file

@ -70,10 +70,7 @@ func (s *ContentStore) Put(meta *models.LFSMetaObject, r io.Reader) error {
return errHashMismatch return errHashMismatch
} }
if err := os.Rename(tmpPath, path); err != nil { return os.Rename(tmpPath, path)
return err
}
return nil
} }
// Exists returns true if the object exists in the content store. // Exists returns true if the object exists in the content store.

View file

@ -110,10 +110,7 @@ func (w *FileLogWriter) StartLogger() error {
return err return err
} }
w.mw.SetFd(fd) w.mw.SetFd(fd)
if err = w.initFd(); err != nil { return w.initFd()
return err
}
return nil
} }
func (w *FileLogWriter) docheck(size int) { func (w *FileLogWriter) docheck(size int) {