X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-parse-remote.sh;h=ea093d251d98af6a3d4df19e900d56df34d51572;hb=abe27c0cbd97bf6a693004ddb411392ed596a853;hp=9b950be28d75b173ed81d5cf83271e9a8c4e6dff;hpb=d12d8ec9d728b0ce148f5a5caa68c858ef180d30;p=git.git diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 9b950be28..ea093d251 100644 --- a/git-parse-remote.sh +++ b/git-parse-remote.sh @@ -4,56 +4,6 @@ # this would fail in that case and would issue an error message. GIT_DIR=$(git rev-parse -q --git-dir) || :; -get_data_source () { - case "$1" in - */*) - echo '' - ;; - .) - echo self - ;; - *) - if test "$(git config --get "remote.$1.url")" - then - echo config - elif test -f "$GIT_DIR/remotes/$1" - then - echo remotes - elif test -f "$GIT_DIR/branches/$1" - then - echo branches - else - echo '' - fi ;; - esac -} - -get_remote_url () { - data_source=$(get_data_source "$1") - case "$data_source" in - '') - echo "$1" - ;; - self) - echo "$1" - ;; - config) - git config --get "remote.$1.url" - ;; - remotes) - sed -ne '/^URL: */{ - s///p - q - }' "$GIT_DIR/remotes/$1" - ;; - branches) - sed -e 's/#.*//' "$GIT_DIR/branches/$1" - ;; - *) - die "internal error: get-remote-url $1" ;; - esac -} - get_default_remote () { curr_branch=$(git symbolic-ref -q HEAD) curr_branch="${curr_branch#refs/heads/}"