X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=git-parse-remote.sh;h=e7013f7ba72a64ab24b991846755b6d6c068b37a;hb=c0aa335c95974caebcc972cd63a11e6ff73b1612;hp=1cc2ba6e09614fa55ad205145a3bdacfb78bf283;hpb=2cf08b6a0ab09f1b81b78a5686a632a2a602abf4;p=git.git diff --git a/git-parse-remote.sh b/git-parse-remote.sh index 1cc2ba6e0..e7013f7ba 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 | sed -e 's|^refs/heads/||') origin=$(git config --get "branch.$curr_branch.remote")