summaryrefslogtreecommitdiff
path: root/git-fetch.sh
diff options
context:
space:
mode:
authorLibravatar Junio C Hamano <junkio@cox.net>2007-01-16 02:31:36 -0800
committerLibravatar Junio C Hamano <junkio@cox.net>2007-02-13 21:43:53 -0800
commitd1e0ef6cc89e5ef2f914c37719b9c2327e534834 (patch)
tree53a654d5b92eba36cdd510df5f0e601c813268e4 /git-fetch.sh
parentgit-fetch: move more code into C. (diff)
downloadtgif-d1e0ef6cc89e5ef2f914c37719b9c2327e534834.tar.xz
git-fetch: rewrite another shell loop in C
Move another shell loop that canonicalizes the list of refs for underlying git-fetch-pack and fetch-native-store into C. This seems to shave the runtime for the same 1000 branch repository from 30 seconds down to 15 seconds (it used to be 2 and half minutes with the original version). Signed-off-by: Junio C Hamano <junkio@cox.net>
Diffstat (limited to 'git-fetch.sh')
-rwxr-xr-xgit-fetch.sh30
1 files changed, 2 insertions, 28 deletions
diff --git a/git-fetch.sh b/git-fetch.sh
index b74dd9a309..3bed4091a3 100755
--- a/git-fetch.sh
+++ b/git-fetch.sh
@@ -155,35 +155,9 @@ then
fi
fetch_native () {
- reflist="$1"
- refs=
- rref=
-
- for ref in $reflist
- do
- refs="$refs$LF$ref"
-
- # These are relative path from $GIT_DIR, typically starting at refs/
- # but may be HEAD
- if expr "z$ref" : 'z\.' >/dev/null
- then
- not_for_merge=t
- ref=$(expr "z$ref" : 'z\.\(.*\)')
- else
- not_for_merge=
- fi
- if expr "z$ref" : 'z+' >/dev/null
- then
- single_force=t
- ref=$(expr "z$ref" : 'z+\(.*\)')
- else
- single_force=
- fi
- remote_name=$(expr "z$ref" : 'z\([^:]*\):')
- local_name=$(expr "z$ref" : 'z[^:]*:\(.*\)')
- rref="$rref$LF$remote_name"
- done
+ eval=$(git-fetch--tool parse-reflist "$1")
+ eval "$eval"
( : subshell because we muck with IFS
IFS=" $LF"