diff options
Diffstat (limited to 'bitbake')
-rw-r--r-- | bitbake/lib/bb/fetch2/git.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py index 97bf0865ac..ff7c33df10 100644 --- a/bitbake/lib/bb/fetch2/git.py +++ b/bitbake/lib/bb/fetch2/git.py | |||
@@ -168,10 +168,11 @@ class Git(FetchMethod): | |||
168 | os.chdir(ud.clonedir) | 168 | os.chdir(ud.clonedir) |
169 | runfetchcmd("tar -xzf %s" % (ud.fullmirror), d) | 169 | runfetchcmd("tar -xzf %s" % (ud.fullmirror), d) |
170 | 170 | ||
171 | repourl = "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path) | ||
172 | |||
171 | # If the repo still doesn't exist, fallback to cloning it | 173 | # If the repo still doesn't exist, fallback to cloning it |
172 | if not os.path.exists(ud.clonedir): | 174 | if not os.path.exists(ud.clonedir): |
173 | clone_cmd = "%s clone --bare --mirror %s://%s%s%s %s" % \ | 175 | clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir) |
174 | (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir) | ||
175 | bb.fetch2.check_network_access(d, clone_cmd) | 176 | bb.fetch2.check_network_access(d, clone_cmd) |
176 | runfetchcmd(clone_cmd, d) | 177 | runfetchcmd(clone_cmd, d) |
177 | 178 | ||
@@ -187,9 +188,9 @@ class Git(FetchMethod): | |||
187 | runfetchcmd("%s remote rm origin" % ud.basecmd, d) | 188 | runfetchcmd("%s remote rm origin" % ud.basecmd, d) |
188 | except bb.fetch2.FetchError: | 189 | except bb.fetch2.FetchError: |
189 | logger.debug(1, "No Origin") | 190 | logger.debug(1, "No Origin") |
190 | 191 | ||
191 | runfetchcmd("%s remote add --mirror origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d) | 192 | runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d) |
192 | fetch_cmd = "%s fetch --all -t" % ud.basecmd | 193 | fetch_cmd = "%s fetch --prune %s refs/*:refs/*" % (ud.basecmd, repourl) |
193 | bb.fetch2.check_network_access(d, fetch_cmd, ud.url) | 194 | bb.fetch2.check_network_access(d, fetch_cmd, ud.url) |
194 | runfetchcmd(fetch_cmd, d) | 195 | runfetchcmd(fetch_cmd, d) |
195 | runfetchcmd("%s prune-packed" % ud.basecmd, d) | 196 | runfetchcmd("%s prune-packed" % ud.basecmd, d) |