From d479aa7b32ddbca5947f6eb178399e47b21e5c25 Mon Sep 17 00:00:00 2001 From: Marcel Klehr Date: Sat, 4 May 2024 14:42:39 +0200 Subject: [PATCH] enh(git): Give more details about profile in label Signed-off-by: Marcel Klehr --- src/lib/adapters/Git.ts | 21 +++++++-------------- 1 file changed, 7 insertions(+), 14 deletions(-) diff --git a/src/lib/adapters/Git.ts b/src/lib/adapters/Git.ts index 7719b04d0c..d9307ddd83 100644 --- a/src/lib/adapters/Git.ts +++ b/src/lib/adapters/Git.ts @@ -49,22 +49,15 @@ export default class GitAdapter extends CachingAdapter { } } - getData() { - return { ...GitAdapter.getDefaultValues(), ...this.server } + getLabel():string { + const data = this.getData() + const url = new URL(data.url) + url.protocol = '' + return data.username + '@' + url.hostname + ':' + data.bookmark_file } - normalizeServerURL(input) { - const serverURL = url.parse(input) - if (!serverURL.pathname) serverURL.pathname = '' - return url.format({ - protocol: serverURL.protocol, - auth: serverURL.auth, - host: serverURL.host, - port: serverURL.port, - pathname: - serverURL.pathname + - (serverURL.pathname[serverURL.pathname.length - 1] !== '/' ? '/' : '') - }) + getData() { + return { ...GitAdapter.getDefaultValues(), ...this.server } } cancel() {