From: Daniel Bevenius Date: Thu, 12 Feb 2026 12:14:28 +0000 (+0100) Subject: scripts : add support for forks in pr2wt.sh (#19540) X-Git-Tag: upstream/0.0.8067~52 X-Git-Url: https://git.djapps.eu/?a=commitdiff_plain;h=ff599039a9f54fc75c0d4202941079058a26de2c;p=pkg%2Fggml%2Fsources%2Fllama.cpp scripts : add support for forks in pr2wt.sh (#19540) This commit adds support for using the pr2wt.sh (pull request to workspace) script with forks of upstream llama.cpp. --- diff --git a/scripts/pr2wt.sh b/scripts/pr2wt.sh index bd635f3b9..067f5d466 100755 --- a/scripts/pr2wt.sh +++ b/scripts/pr2wt.sh @@ -30,12 +30,18 @@ fi PR=$1 [[ "$PR" =~ ^[0-9]+$ ]] || { echo "error: PR number must be numeric"; exit 1; } +url_origin=$(git config --get remote.upstream.url 2>/dev/null) || \ url_origin=$(git config --get remote.origin.url) || { - echo "error: no remote named 'origin' in this repository" + echo "error: no remote named 'upstream' or 'origin' in this repository" exit 1 } -org_repo=$(echo $url_origin | cut -d/ -f4-) +# Extract org/repo from either https or ssh format. +if [[ $url_origin =~ ^git@ ]]; then + org_repo=$(echo $url_origin | cut -d: -f2) +else + org_repo=$(echo $url_origin | cut -d/ -f4-) +fi org_repo=${org_repo%.git} echo "org/repo: $org_repo"