allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [1/3] git commit: [#7207] ticket:552 refactoring get_default_branch
Date Tue, 01 Apr 2014 14:03:09 GMT
Repository: allura
Updated Branches:
  refs/heads/master 2ea41b189 -> f72b7fdbc


[#7207] ticket:552 refactoring get_default_branch


Project: http://git-wip-us.apache.org/repos/asf/allura/repo
Commit: http://git-wip-us.apache.org/repos/asf/allura/commit/8e075a09
Tree: http://git-wip-us.apache.org/repos/asf/allura/tree/8e075a09
Diff: http://git-wip-us.apache.org/repos/asf/allura/diff/8e075a09

Branch: refs/heads/master
Commit: 8e075a09fdd4e9d2844ceb0106571863d557f5af
Parents: 6d1d1e4
Author: Yuriy Arhipov <yuriyarhipovua@yandex.ru>
Authored: Tue Mar 11 14:37:02 2014 +0400
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Mon Mar 31 18:27:01 2014 +0000

----------------------------------------------------------------------
 Allura/allura/model/repository.py | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/allura/blob/8e075a09/Allura/allura/model/repository.py
----------------------------------------------------------------------
diff --git a/Allura/allura/model/repository.py b/Allura/allura/model/repository.py
index b4c5d64..6e63cb3 100644
--- a/Allura/allura/model/repository.py
+++ b/Allura/allura/model/repository.py
@@ -670,9 +670,9 @@ class Repository(Artifact, ActivityObject):
         branch_names = []
 
         if not self.is_empty():
-            branch_names = [b.name for b in self._impl.branches]
+            branch_names = [b.name for b in self.get_branches()]
         if default_branch_name not in branch_names:
-            if (default_name in branch_names) or (len(branch_names) == 0):
+            if len(branch_names) == 0:
                 default_branch_name = default_name
             else:
                 default_branch_name = branch_names[0]
@@ -680,7 +680,6 @@ class Repository(Artifact, ActivityObject):
         return default_branch_name
 
 
-
 class MergeRequest(VersionedArtifact, ActivityObject):
     statuses = ['open', 'merged', 'rejected']
 


Mime
View raw message