]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
fetch2/git: Anchor names when using ls-remote
authorRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2014 14:30:11 +0000 (14:30 +0000)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Mon, 20 Jan 2014 20:39:41 +0000 (20:39 +0000)
When specifying tags, they're searched for unanchored so foo/bar could
match:

refs/heads/abc/foo/bar
refs/heads/xyz/foo/bar
refs/heads/foo/bar

This change anchors the expressions so they are based against heads
or tags (or any other base level tree that has been created).

Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
lib/bb/fetch2/git.py

index cae165316cd1a82e34bd91e8bbb97be56b7b28bb..d73f0cbecf9e919bb3cc0766f6f7d9632f40061c 100644 (file)
@@ -326,8 +326,8 @@ class Git(FetchMethod):
         else:
             username = ""
 
-        cmd = "%s ls-remote %s://%s%s%s %s" % \
-              (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name])
+        cmd = "%s ls-remote %s://%s%s%s refs/heads/%s refs/tags/%s" % \
+              (ud.basecmd, ud.proto, username, ud.host, ud.path, ud.unresolvedrev[name], ud.unresolvedrev[name])
         if ud.proto.lower() != 'file':
             bb.fetch2.check_network_access(d, cmd)
         output = runfetchcmd(cmd, d, True)