summaryrefslogtreecommitdiff
path: root/git-parse-remote.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2005-09-18 01:18:15 -0700
committerLibravatar Junio C Hamano <junkio@cox.net>2005-09-18 01:18:15 -0700
commit8ac93bc98f5e868e890e1a740df9f0c6513189c8 (patch)
treec1c1e3c93a3ca5adc86d67d4d55544bab09f2586 /git-parse-remote.sh
parentMerge branch 'master' of . (diff)
parentImprove the safety check used in fetch.c (diff)
downloadtgif-8ac93bc98f5e868e890e1a740df9f0c6513189c8.tar.xz
Merge branch 'master' of .
Diffstat (limited to 'git-parse-remote.sh')
-rwxr-xr-xgit-parse-remote.sh21
1 files changed, 21 insertions, 0 deletions
diff --git a/git-parse-remote.sh b/git-parse-remote.sh
index 3c5d94b344..a9db0cd825 100755
--- a/git-parse-remote.sh
+++ b/git-parse-remote.sh
@@ -153,3 +153,24 @@ get_remote_refs_for_fetch () {
;;
esac
}
+
+resolve_alternates () {
+ # original URL (xxx.git)
+ top_=`expr "$1" : '\([^:]*:/*[^/]*\)/'`
+ while read path
+ do
+ case "$path" in
+ \#* | '')
+ continue ;;
+ /*)
+ echo "$top_$path/" ;;
+ ../*)
+ # relative -- ugly but seems to work.
+ echo "$1/objects/$path/" ;;
+ *)
+ # exit code may not be caught by the reader.
+ echo "bad alternate: $path"
+ exit 1 ;;
+ esac
+ done
+}