fix: Make ssh remote url more robustw

This commit is contained in:
demenik
2025-12-02 18:17:12 +01:00
parent 8899266f88
commit 2e757e5192

View File

@@ -28,10 +28,10 @@ fi
REMOTE_URL=$(git config --get remote.origin.url)
REPO_URL=""
if [[ "$REMOTE_URL" == *"github.com"* || $REMOTE_URL == *"gitlab.com"* || $REMOTE_URL == *"gitlab.uni-ulm.de"* ]]; then
if [[ "$REMOTE_URL" == git@* ]]; then
REPO_URL=$(echo "$REMOTE_URL" | sed -E 's/git@([^:]+):/https:\/\/\1\//')
REPO_URL=${REPO_URL%.git}
fi
REPO_URL=${REPO_URL%.git}
get_commit_link() {
local hash=$1