]> git.ipfire.org Git - thirdparty/git.git/commitdiff
Merge branch 'jk/fix-remote-curl-url-wo-proto' into maint
authorJunio C Hamano <gitster@pobox.com>
Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 29 Sep 2016 23:49:38 +0000 (16:49 -0700)
"git fetch http::/site/path" did not die correctly and segfaulted
instead.

* jk/fix-remote-curl-url-wo-proto:
  remote-curl: handle URLs without protocol

1  2 
http.c
t/t5550-http-fetch-dumb.sh

diff --cc http.c
Simple merge
index dc9b87d6b41efc472eac1a2b768bf56c01caf4d1,9249140f99890f67d57d689884ba2975bb1bd39f..7641417b4a3848fa9d065572e5a8248fea5c7574
@@@ -295,9 -246,17 +295,17 @@@ ja;q=0.95, zh;q=0.94, sv;q=0.93, pt;q=0
  '
  
  test_expect_success 'git client does not send an empty Accept-Language' '
 -      GIT_CURL_VERBOSE=1 LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
 -      ! grep "^Accept-Language:" stderr
 +      GIT_TRACE_CURL=true LANGUAGE= git ls-remote "$HTTPD_URL/dumb/repo.git" 2>stderr &&
 +      ! grep "^=> Send header: Accept-Language:" stderr
  '
  
+ test_expect_success 'remote-http complains cleanly about malformed urls' '
+       # do not actually issue "list" or other commands, as we do not
+       # want to rely on what curl would actually do with such a broken
+       # URL. This is just about making sure we do not segfault during
+       # initialization.
+       test_must_fail git remote-http http::/example.com/repo.git
+ '
  stop_httpd
  test_done