Skip to content

Commit af81b21

Browse files
author
Gusted
committed
Remove left-overs
1 parent b2653cd commit af81b21

File tree

4 files changed

+2
-55
lines changed

4 files changed

+2
-55
lines changed

models/repo/repo.go

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,6 @@ type Repository struct {
144144
IsFsckEnabled bool `xorm:"NOT NULL DEFAULT true"`
145145
CloseIssuesViaCommitInAnyBranch bool `xorm:"NOT NULL DEFAULT false"`
146146
Topics []string `xorm:"TEXT JSON"`
147-
PrivateSSHKey string `xorm:"TEXT"`
148-
PublicSSHKey string `xorm:"TEXT"`
149147

150148
TrustModel TrustModelType
151149

modules/git/repo.go

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,6 @@ func Push(ctx context.Context, repoPath string, opts PushOptions) error {
211211
opts.Timeout = -1
212212
}
213213

214-
fmt.Println(cmd.String(), repoPath)
215214
err := cmd.RunWithContext(&RunContext{
216215
Env: opts.Env,
217216
Timeout: opts.Timeout,

services/forms/repo_form.go

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -97,8 +97,7 @@ func ParseRemoteAddr(remoteAddr, authUsername, authPassword string) (string, err
9797
// Remote address can be HTTP/HTTPS/Git URL or local path.
9898
if strings.HasPrefix(remoteAddr, "http://") ||
9999
strings.HasPrefix(remoteAddr, "https://") ||
100-
strings.HasPrefix(remoteAddr, "git://") ||
101-
strings.HasPrefix(remoteAddr, "ssh://") {
100+
strings.HasPrefix(remoteAddr, "git://") {
102101
u, err := url.Parse(remoteAddr)
103102
if err != nil {
104103
return "", &models.ErrInvalidCloneAddr{IsURLError: true}

web_src/js/features/repo-settings.js

Lines changed: 1 addition & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import $ from 'jquery';
22
import {createMonaco} from './codeeditor.js';
33
import {initRepoCommonFilterSearchDropdown} from './repo-common.js';
44

5-
const {appSubUrl, csrfToken, pageData} = window.config;
5+
const {appSubUrl, csrfToken} = window.config;
66

77
export function initRepoSettingsCollaboration() {
88
// Change collaborator access mode
@@ -65,52 +65,3 @@ export function initRepoSettingBranches() {
6565
});
6666
}
6767
}
68-
69-
export function initRepoSettingsSSHAuthorization() {
70-
const generateButton = document.querySelector('#generate-ssh-key');
71-
if (!generateButton) {
72-
return;
73-
}
74-
const deleteSSHButton = document.querySelector('#delete-ssh-key');
75-
const generateButtonForm = generateButton.closest('form');
76-
77-
generateButton.addEventListener('click', async () => {
78-
const resp = await fetch(pageData.GenerateSSHKey, {
79-
'method': 'GET',
80-
'cache': 'no-cache',
81-
'headers': {'X-Csrf-Token': csrfToken},
82-
});
83-
const bodyJson = await resp.json();
84-
if (bodyJson['error']) {
85-
return;
86-
}
87-
document.querySelector('.password-auth').setAttribute('hidden', '');
88-
document.querySelector('.ssh-auth').removeAttribute('hidden');
89-
deleteSSHButton.style.display = '';
90-
91-
document.querySelector('#public-ssh-key-content').textContent = bodyJson['public_ssh_key'];
92-
});
93-
94-
deleteSSHButton.addEventListener('click', async () => {
95-
const resp = await fetch(pageData.GenerateSSHKey.replace('generate_ssh', 'delete_ssh'), {
96-
'method': 'GET',
97-
'cache': 'no-cache',
98-
'headers': {'X-Csrf-Token': csrfToken},
99-
});
100-
const bodyJson = await resp.json();
101-
if (bodyJson['error']) {
102-
return;
103-
}
104-
document.querySelector('.password-auth').removeAttribute('hidden');
105-
document.querySelector('.ssh-auth').setAttribute('hidden', '');
106-
deleteSSHButton.style.display = 'none';
107-
});
108-
109-
// Avoid that the SSH buttons causes the form to submit.
110-
generateButtonForm.addEventListener('submit', (ev) => {
111-
if (ev.submitter.id === 'generate-ssh-key' || ev.submitter.id === 'delete-ssh-key') {
112-
ev.preventDefault();
113-
return false;
114-
}
115-
});
116-
}

0 commit comments

Comments
 (0)