summaryrefslogtreecommitdiff
path: root/t/t5550-http-fetch.sh
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2009-02-27 14:10:06 -0500
committerJunio C Hamano <gitster@pobox.com>2009-02-27 15:19:23 -0800
commitfbb074c25352627f650d2ea528ed694e77bece0f (patch)
tree324a0f275d71a84bb7ce645d5f28a6651649d3b6 /t/t5550-http-fetch.sh
parentbc14fac825d9728c311aaa9d0aecf4960d4a3103 (diff)
downloadgit-fbb074c25352627f650d2ea528ed694e77bece0f.tar.gz
remote: make guess_remote_head() use exact HEAD lookup if it is available
Our usual method for determining the ref pointed to by HEAD is to compare HEAD's sha1 to the sha1 of all refs, trying to find a unique match. However, some transports actually get to look at HEAD directly; we should make use of that information when it is available. Currently, only http remotes support this feature. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Jay Soffian <jaysoffian@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t5550-http-fetch.sh')
-rwxr-xr-xt/t5550-http-fetch.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/t/t5550-http-fetch.sh b/t/t5550-http-fetch.sh
index b6e6ec9607..05b1b62cb6 100755
--- a/t/t5550-http-fetch.sh
+++ b/t/t5550-http-fetch.sh
@@ -42,5 +42,16 @@ test_expect_success 'fetch changes via http' '
test_cmp file clone/file
'
+test_expect_success 'http remote detects correct HEAD' '
+ git push public master:other &&
+ (cd clone &&
+ git remote set-head origin -d &&
+ git remote set-head origin -a &&
+ git symbolic-ref refs/remotes/origin/HEAD > output &&
+ echo refs/remotes/origin/master > expect &&
+ test_cmp expect output
+ )
+'
+
stop_httpd
test_done