/brz/remove-bazaar

To get this branch, use:
bzr branch http://gegoxaren.bato24.eu/bzr/brz/remove-bazaar

« back to all changes in this revision

Viewing changes to breezy/git/__init__.py

  • Committer: Breezy landing bot
  • Author(s): Jelmer Vernooij
  • Date: 2019-02-14 19:32:00 UTC
  • mfrom: (7268.10.4 git-http-username)
  • Revision ID: breezy.the.bot@gmail.com-20190214193200-l4f05nzr408mv5qw
Strip username from URLs before passing them to httplib.

This fixes access to Git HTTP repositories with authentication, such as bitbucket.

Merged from https://code.launchpad.net/~jelmer/brz/git-http-username/+merge/363182

Show diffs side-by-side

added added

removed removed

Lines of Context:
145
145
class RemoteGitProber(Prober):
146
146
 
147
147
    def probe_http_transport(self, transport):
 
148
        # This function intentionally doesn't use any of the support code under
 
149
        # breezy.git, since it's called for every repository that's
 
150
        # accessed over HTTP, whether it's Git, Bzr or something else.
 
151
        # Importing Dulwich and the other support code adds unnecessray slowdowns.
148
152
        from .. import urlutils
149
153
        base_url, _ = urlutils.split_segment_parameters(
150
154
            transport.external_url())
151
 
        url = urlutils.join(base_url, "info/refs") + "?service=git-upload-pack"
 
155
        url = urlutils.URL.from_string(base_url)
 
156
        url.user = url.quoted_user = None
 
157
        url.password = url.quoted_password = None
 
158
        url = urlutils.join(str(url), "info/refs") + "?service=git-upload-pack"
152
159
        from ..transport.http import Request
153
160
        headers = {"Content-Type": "application/x-git-upload-pack-request",
154
161
                   "Accept": "application/x-git-upload-pack-result",