@matheusbsbs / matheus-bagliano / commits / ea560e6d64
Fork 0

Do not support "partial URL shorthand" anymore.

We used to support specifying the top part of remote URL in remotes and use that as a short-hand for the URL. $ cat .git/remotes/jgarzik URL: git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/ $ git pull jgarzik/misc-2.6 This is confusing when somebody attempts to do this: $ git pull origin/foo which is not syntactically correct (unless you have origin/foo.git repository) and should fail, but it resulted in a mysterious access to the 'foo' subdirectory of the origin repository. Which was what it was designed to do, but because this is an oddball "feature" I suspect nobody uses, let's remove it. Signed-off-by: Junio C Hamano <junkio@cox.net>

Junio C Hamano committed Dec 22, 2006 at 15:37 UTC ea560e6d64374ec1f6c163c276319a3da21a1345
1 file changed +7 -27
git-parse-remote.sh
+7 -27
@@ -7,18 +7,7 @@ GIT_DIR=$(git-rev-parse --git-dir 2>/dev/null) || :;
7 get_data_source () {
8 case "$1" in
9 */*)
10 - # Not so fast. This could be the partial URL shorthand...
11 - token=$(expr "z$1" : 'z\([^/]*\)/')
12 - remainder=$(expr "z$1" : 'z[^/]*/\(.*\)')
13 - if test "$(git-repo-config --get "remote.$token.url")"
14 - then
15 - echo config-partial
16 - elif test -f "$GIT_DIR/branches/$token"
17 - then
18 - echo branches-partial
19 - else
20 - echo ''
21 - fi
10 + echo ''
11 ;;
12 *)
13 if test "$(git-repo-config --get "remote.$1.url")"
@@ -40,12 +29,7 @@ get_remote_url () {
29 data_source=$(get_data_source "$1")
30 case "$data_source" in
31 '')
43 - echo "$1" ;;
44 - config-partial)
45 - token=$(expr "z$1" : 'z\([^/]*\)/')
46 - remainder=$(expr "z$1" : 'z[^/]*/\(.*\)')
47 - url=$(git-repo-config --get "remote.$token.url")
48 - echo "$url/$remainder"
32 + echo "$1"
33 ;;
34 config)
35 git-repo-config --get "remote.$1.url"
@@ -54,14 +38,10 @@ get_remote_url () {
38 sed -ne '/^URL: */{
39 s///p
40 q
57 - }' "$GIT_DIR/remotes/$1" ;;
41 + }' "$GIT_DIR/remotes/$1"
42 + ;;
43 branches)
59 - sed -e 's/#.*//' "$GIT_DIR/branches/$1" ;;
60 - branches-partial)
61 - token=$(expr "z$1" : 'z\([^/]*\)/')
62 - remainder=$(expr "z$1" : 'z[^/]*/\(.*\)')
63 - url=$(sed -e 's/#.*//' "$GIT_DIR/branches/$token")
64 - echo "$url/$remainder"
44 + sed -e 's/#.*//' "$GIT_DIR/branches/$1"
45 ;;
46 *)
47 die "internal error: get-remote-url $1" ;;
@@ -77,7 +57,7 @@ get_default_remote () {
57 get_remote_default_refs_for_push () {
58 data_source=$(get_data_source "$1")
59 case "$data_source" in
80 - '' | config-partial | branches | branches-partial)
60 + '' | branches)
61 ;; # no default push mapping, just send matching refs.
62 config)
63 git-repo-config --get-all "remote.$1.push" ;;
@@ -196,7 +176,7 @@ canon_refs_list_for_fetch () {
176 get_remote_default_refs_for_fetch () {
177 data_source=$(get_data_source "$1")
178 case "$data_source" in
199 - '' | config-partial | branches-partial)
179 + '')
180 echo "HEAD:" ;;
181 config)
182 canon_refs_list_for_fetch -d "$1" \