diff --git a/lib/bb/fetch2/git.py b/lib/bb/fetch2/git.py
index 0fbd85441..3f723ca62 100644
--- a/lib/bb/fetch2/git.py
+++ b/lib/bb/fetch2/git.py
@@ -640,7 +640,7 @@ class Git(FetchMethod):
             if '*' in r:
                 matches = filter(lambda a: fnmatch.fnmatchcase(a, r), all_refs)
                 extra_refs.extend(matches)
-            else:
+            elif r in all_refs:
                 extra_refs.append(r)
 
         for ref in extra_refs:
