Add integrations tests from git cli (#3377)

* test: integration add git cli tests

Extracted form for easing review process and debug #3152

* test: integration add git cli big file commit

* fix:  Don't rewrite key if internal server
This commit is contained in:
Antoine GIRARD 2018-01-16 12:07:47 +01:00 committed by Lauris BH
parent 695b10bedd
commit 095fb9f2e3
6 changed files with 258 additions and 142 deletions

View file

@ -304,6 +304,11 @@ func CheckPublicKeyString(content string) (_ string, err error) {
// appendAuthorizedKeysToFile appends new SSH keys' content to authorized_keys file.
func appendAuthorizedKeysToFile(keys ...*PublicKey) error {
// Don't need to rewrite this file if builtin SSH server is enabled.
if setting.SSH.StartBuiltinServer {
return nil
}
sshOpLocker.Lock()
defer sshOpLocker.Unlock()
@ -532,6 +537,11 @@ func DeletePublicKey(doer *User, id int64) (err error) {
// Note: x.Iterate does not get latest data after insert/delete, so we have to call this function
// outside any session scope independently.
func RewriteAllPublicKeys() error {
//Don't rewrite key if internal server
if setting.SSH.StartBuiltinServer {
return nil
}
sshOpLocker.Lock()
defer sshOpLocker.Unlock()