0
0
mirror of https://github.com/go-gitea/gitea.git synced 2026-06-21 23:17:38 +02:00
This commit is contained in:
pomidorry 2026-06-07 19:52:59 +03:00
parent 6bc7ee657b
commit 9d4c76a5e1
2 changed files with 1 additions and 9 deletions

View File

@ -52,11 +52,3 @@ func TestMigrateOptionsSSHKeyOwnerIDRoundtrip(t *testing.T) {
assert.Equal(t, int64(42), got.SSHKeyOwnerID)
}
// TestMigrateOptionsSSHKeyOwnerIDOmitemptyZero ensures the default value (use
// repository owner's key) is omitted from the serialised JSON so existing task
// payloads in the DB stay compact and backward-compatible.
func TestMigrateOptionsSSHKeyOwnerIDOmitemptyZero(t *testing.T) {
data, err := json.Marshal(MigrateOptions{})
assert.NoError(t, err)
assert.NotContains(t, string(data), "ssh_key_owner_id")
}

View File

@ -19,7 +19,7 @@ type MigrateOptions struct {
AuthTokenEncrypted string `json:"auth_token_encrypted,omitempty"`
// SSHKeyOwnerID overrides the owner whose managed SSH keypair authenticates
// the SSH clone. 0 means use the target repository owner (the default).
SSHKeyOwnerID int64 `json:"ssh_key_owner_id,omitempty"`
SSHKeyOwnerID int64 `json:"ssh_key_owner_id"`
// required: true
UID int `json:"uid" binding:"Required"`
// required: true