diff options
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 3 | ||||
-rw-r--r-- | bitbake/lib/bb/tests/fetch.py | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 9a15abaa79..a73fb79ac8 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -81,6 +81,7 @@ import shlex | |||
81 | import shutil | 81 | import shutil |
82 | import subprocess | 82 | import subprocess |
83 | import tempfile | 83 | import tempfile |
84 | import urllib | ||
84 | import bb | 85 | import bb |
85 | import bb.progress | 86 | import bb.progress |
86 | from contextlib import contextmanager | 87 | from contextlib import contextmanager |
@@ -888,7 +889,7 @@ class Git(FetchMethod): | |||
888 | username = ud.user + '@' | 889 | username = ud.user + '@' |
889 | else: | 890 | else: |
890 | username = "" | 891 | username = "" |
891 | return "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path) | 892 | return "%s://%s%s%s" % (ud.proto, username, ud.host, urllib.parse.quote(ud.path)) |
892 | 893 | ||
893 | def _revision_key(self, ud, d, name): | 894 | def _revision_key(self, ud, d, name): |
894 | """ | 895 | """ |
diff --git a/bitbake/lib/bb/tests/fetch.py b/bitbake/lib/bb/tests/fetch.py index d000dc465d..0c87730c5e 100644 --- a/bitbake/lib/bb/tests/fetch.py +++ b/bitbake/lib/bb/tests/fetch.py | |||
@@ -2508,11 +2508,13 @@ class GitURLWithSpacesTest(FetcherTest): | |||
2508 | test_git_urls = { | 2508 | test_git_urls = { |
2509 | "git://tfs-example.org:22/tfs/example%20path/example.git;branch=master" : { | 2509 | "git://tfs-example.org:22/tfs/example%20path/example.git;branch=master" : { |
2510 | 'url': 'git://tfs-example.org:22/tfs/example%20path/example.git;branch=master', | 2510 | 'url': 'git://tfs-example.org:22/tfs/example%20path/example.git;branch=master', |
2511 | 'repo_url': 'git://tfs-example.org:22/tfs/example%20path/example.git', | ||
2511 | 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example.git', | 2512 | 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example.git', |
2512 | 'path': '/tfs/example path/example.git' | 2513 | 'path': '/tfs/example path/example.git' |
2513 | }, | 2514 | }, |
2514 | "git://tfs-example.org:22/tfs/example%20path/example%20repo.git;branch=master" : { | 2515 | "git://tfs-example.org:22/tfs/example%20path/example%20repo.git;branch=master" : { |
2515 | 'url': 'git://tfs-example.org:22/tfs/example%20path/example%20repo.git;branch=master', | 2516 | 'url': 'git://tfs-example.org:22/tfs/example%20path/example%20repo.git;branch=master', |
2517 | 'repo_url': 'git://tfs-example.org:22/tfs/example%20path/example%20repo.git', | ||
2516 | 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example_repo.git', | 2518 | 'gitsrcname': 'tfs-example.org.22.tfs.example_path.example_repo.git', |
2517 | 'path': '/tfs/example path/example repo.git' | 2519 | 'path': '/tfs/example path/example repo.git' |
2518 | } | 2520 | } |
@@ -2535,6 +2537,7 @@ class GitURLWithSpacesTest(FetcherTest): | |||
2535 | self.assertEqual(ud.lockfile, os.path.join(self.dldir, "git2", ref['gitsrcname'] + '.lock')) | 2537 | self.assertEqual(ud.lockfile, os.path.join(self.dldir, "git2", ref['gitsrcname'] + '.lock')) |
2536 | self.assertEqual(ud.clonedir, os.path.join(self.dldir, "git2", ref['gitsrcname'])) | 2538 | self.assertEqual(ud.clonedir, os.path.join(self.dldir, "git2", ref['gitsrcname'])) |
2537 | self.assertEqual(ud.fullmirror, os.path.join(self.dldir, "git2_" + ref['gitsrcname'] + '.tar.gz')) | 2539 | self.assertEqual(ud.fullmirror, os.path.join(self.dldir, "git2_" + ref['gitsrcname'] + '.tar.gz')) |
2540 | self.assertEqual(ud.method._get_repo_url(ud), ref['repo_url']) | ||
2538 | 2541 | ||
2539 | class CrateTest(FetcherTest): | 2542 | class CrateTest(FetcherTest): |
2540 | @skipIfNoNetwork() | 2543 | @skipIfNoNetwork() |