<p>Joshua Colp has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/8909">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">testsuite: Check origin branch, not local branch.<br><br>When creating a new branch we can't assume that a local<br>branch will already exist. We have to check that it exists<br>in the origin remote. The act of checking it out will then<br>create a local branch.<br><br>Change-Id: I9cc8d3c1fc52c76cf93351480f4b460a70ba625e<br>---<br>M digium_git.py<br>M testsuite.py<br>2 files changed, 14 insertions(+), 1 deletion(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/repotools refs/changes/09/8909/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">diff --git a/digium_git.py b/digium_git.py<br>index 7cd7c1e..0512642 100644<br>--- a/digium_git.py<br>+++ b/digium_git.py<br>@@ -249,6 +249,19 @@<br> <br>         return name in self.repo.heads<br> <br>+    def origin_branch_exists(self, name):<br>+        """Determine if a branch exists on the origin<br>+<br>+        Keyword Arguments:<br>+        name - The name of the branch to look for<br>+<br>+        Returns:<br>+        True if the branch exists<br>+        False if the branch does not<br>+        """<br>+<br>+        return name in self.repo.remotes.origin.refs<br>+<br>     def _push_updated_branches(self):<br>         """Push new or updated branches to the remote repository."""<br> <br>diff --git a/testsuite.py b/testsuite.py<br>index e60e24a..0724dcb 100644<br>--- a/testsuite.py<br>+++ b/testsuite.py<br>@@ -130,7 +130,7 @@<br>             # tag(s) should already exist.<br>             base = version.branch_name(prefix=False)<br> <br>-            if not self.branch_exists(base):<br>+            if not self.origin_branch_exists(base):<br>                 # If for some reason the base branch doesn't exist (release<br>                 # branch was deleted prior to creating the prefixed branch)<br>                 # then use the latest tag instead.<br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/8909">change 8909</a>. To unsubscribe, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/8909"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: repotools </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: I9cc8d3c1fc52c76cf93351480f4b460a70ba625e </div>
<div style="display:none"> Gerrit-Change-Number: 8909 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Joshua Colp <jcolp@digium.com> </div>