summaryrefslogtreecommitdiffstats
path: root/bitbake
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-30 20:39:58 +0000
committerRichard Purdie <richard.purdie@linuxfoundation.org>2011-08-31 19:38:28 +0100
commit9958a579e7486a245680094dd43a1bffa8dfb02c (patch)
tree05f58aebe93b9be81b430ebf6ba6c9f6192a435b /bitbake
parent64327ba9ea1d1cefab1bc35d456da68bc061dcf5 (diff)
downloadast2050-yocto-poky-9958a579e7486a245680094dd43a1bffa8dfb02c.zip
ast2050-yocto-poky-9958a579e7486a245680094dd43a1bffa8dfb02c.tar.gz
bitbake/fetch2/git: Ensure .gitconfig file is ignored
If a user has a ~/.gitconfig file, git fetch --all will reference it. To avoid this we should run git fetch with an explicit url telling it to fetch all references (which includes tags). I'm assured this means git won't reference the file, see the discussion on the git mailing list (subject Overriding ~/.gitconfig using GIT_CONFIG). [YOCTO #1134] (Bitbake rev: 8540c09d4e509e3277940464c71174d8a0aca6ab) Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'bitbake')
-rw-r--r--bitbake/lib/bb/fetch2/git.py11
1 files changed, 6 insertions, 5 deletions
diff --git a/bitbake/lib/bb/fetch2/git.py b/bitbake/lib/bb/fetch2/git.py
index 97bf086..ff7c33d 100644
--- a/bitbake/lib/bb/fetch2/git.py
+++ b/bitbake/lib/bb/fetch2/git.py
@@ -168,10 +168,11 @@ class Git(FetchMethod):
os.chdir(ud.clonedir)
runfetchcmd("tar -xzf %s" % (ud.fullmirror), d)
+ repourl = "%s://%s%s%s" % (ud.proto, username, ud.host, ud.path)
+
# If the repo still doesn't exist, fallback to cloning it
if not os.path.exists(ud.clonedir):
- clone_cmd = "%s clone --bare --mirror %s://%s%s%s %s" % \
- (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.clonedir)
+ clone_cmd = "%s clone --bare --mirror %s %s" % (ud.basecmd, repourl, ud.clonedir)
bb.fetch2.check_network_access(d, clone_cmd)
runfetchcmd(clone_cmd, d)
@@ -187,9 +188,9 @@ class Git(FetchMethod):
runfetchcmd("%s remote rm origin" % ud.basecmd, d)
except bb.fetch2.FetchError:
logger.debug(1, "No Origin")
-
- runfetchcmd("%s remote add --mirror origin %s://%s%s%s" % (ud.basecmd, ud.proto, username, ud.host, ud.path), d)
- fetch_cmd = "%s fetch --all -t" % ud.basecmd
+
+ runfetchcmd("%s remote add --mirror=fetch origin %s" % (ud.basecmd, repourl), d)
+ fetch_cmd = "%s fetch --prune %s refs/*:refs/*" % (ud.basecmd, repourl)
bb.fetch2.check_network_access(d, fetch_cmd, ud.url)
runfetchcmd(fetch_cmd, d)
runfetchcmd("%s prune-packed" % ud.basecmd, d)
OpenPOWER on IntegriCloud