summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorConley Owens <cco3@android.com>2014-02-11 18:44:58 -0800
committerConley Owens <cco3@android.com>2014-02-12 09:11:00 -0800
commit565480588d2bff4205b437862505e77382189811 (patch)
treecaf6d315bb10bcdbc10e84dfae62ab755bcaa014 /project.py
parent1966133f8e82971f2e247a8579735a3b2f19301d (diff)
downloadgit-repo-565480588d2bff4205b437862505e77382189811.tar.gz
Check for existence of refs upon initial fetch
When we do an initial fetch and have not specified any branch etc, the following fetch command will not error: git fetch origin --tags +refs/heads/*:refs/remotes/origin/* In this change we make sure something got fetched and if not we report an error. This fixes the bug that occurs when we init using a bad manifest url and then are unable to init again (because a manifest project has been inited with no manifest). Change-Id: I6f8aaefc83a1837beb10b1ac90bea96dc8e61156
Diffstat (limited to 'project.py')
-rw-r--r--project.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/project.py b/project.py
index a1249a86..73a97812 100644
--- a/project.py
+++ b/project.py
@@ -1748,6 +1748,7 @@ class Project(object):
1748 cmd.append('--no-tags') 1748 cmd.append('--no-tags')
1749 else: 1749 else:
1750 cmd.append('--tags') 1750 cmd.append('--tags')
1751
1751 cmd.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*'))) 1752 cmd.append(str((u'+refs/heads/*:') + remote.ToLocal('refs/heads/*')))
1752 elif tag_name is not None: 1753 elif tag_name is not None:
1753 cmd.append('tag') 1754 cmd.append('tag')
@@ -1774,6 +1775,11 @@ class Project(object):
1774 time.sleep(random.randint(30, 45)) 1775 time.sleep(random.randint(30, 45))
1775 1776
1776 if initial: 1777 if initial:
1778 # Ensure that some refs exist. Otherwise, we probably aren't looking
1779 # at a real git repository and may have a bad url.
1780 if not self.bare_ref.all:
1781 ok = False
1782
1777 if alt_dir: 1783 if alt_dir:
1778 if old_packed != '': 1784 if old_packed != '':
1779 _lwrite(packed_refs, old_packed) 1785 _lwrite(packed_refs, old_packed)