diff options
author | Antoine GIRARD <sapk@users.noreply.github.com> | 2018-01-16 12:07:47 +0100 |
---|---|---|
committer | Lauris BH <lauris@nix.lv> | 2018-01-16 13:07:47 +0200 |
commit | 095fb9f2e32fe78acb9bc034f0e1d60922ff1e60 (patch) | |
tree | 508614b1049937fb8a9fa6eabe81470b50d5eff4 /models | |
parent | 695b10beddc640d333fd5864cb6edb03e540b344 (diff) | |
download | gitea-095fb9f2e32fe78acb9bc034f0e1d60922ff1e60.tar.gz gitea-095fb9f2e32fe78acb9bc034f0e1d60922ff1e60.zip |
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
Diffstat (limited to 'models')
-rw-r--r-- | models/ssh_key.go | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/models/ssh_key.go b/models/ssh_key.go index 2878177d44..e121b0d5bd 100644 --- a/models/ssh_key.go +++ b/models/ssh_key.go @@ -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() |