summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorDavid Turner <dturner@twopensource.com>2014-06-04 03:38:10 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-05 22:24:50 (GMT)
commitdde8a902c774268628015705a7767f61af18b865 (patch)
tree063e41ca57518a1e61774f5f5bab1f51c528e083 /t
parent79dcccc503ac228630ecf15dcf8e1d9455daef2d (diff)
downloadgit-dde8a902c774268628015705a7767f61af18b865.zip
git-dde8a902c774268628015705a7767f61af18b865.tar.gz
git-dde8a902c774268628015705a7767f61af18b865.tar.bz2
refs.c: optimize check_refname_component()
In a repository with many refs, check_refname_component can be a major contributor to the runtime of some git commands. One such command is git rev-parse HEAD Timings for one particular repo, with about 60k refs, almost all packed, are: Old: 35 ms New: 29 ms Many other commands which read refs are also sped up. Signed-off-by: David Turner <dturner@twitter.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t5511-refspec.sh6
1 files changed, 5 insertions, 1 deletions
diff --git a/t/t5511-refspec.sh b/t/t5511-refspec.sh
index c289322..de6db86 100755
--- a/t/t5511-refspec.sh
+++ b/t/t5511-refspec.sh
@@ -5,7 +5,6 @@ test_description='refspec parsing'
. ./test-lib.sh
test_refspec () {
-
kind=$1 refspec=$2 expect=$3
git config remote.frotz.url "." &&
git config --remove-section remote.frotz &&
@@ -84,4 +83,9 @@ test_refspec push 'refs/heads/*/*/for-linus:refs/remotes/mine/*' invalid
test_refspec fetch 'refs/heads/*/for-linus:refs/remotes/mine/*'
test_refspec push 'refs/heads/*/for-linus:refs/remotes/mine/*'
+good=$(printf '\303\204')
+test_refspec fetch "refs/heads/${good}"
+bad=$(printf '\011tab')
+test_refspec fetch "refs/heads/${bad}" invalid
+
test_done