incubator-allura-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From john...@apache.org
Subject [2/4] git commit: [#6222] ticket:349 Handle git errors gracefully in symbolics_for_commit
Date Fri, 10 May 2013 16:05:46 GMT
[#6222] ticket:349 Handle git errors gracefully in symbolics_for_commit


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

Branch: refs/heads/master
Commit: d65a4892334f5b3b2bf70ac92d4e45e7eef49586
Parents: 6db9bdf
Author: Igor Bondarenko <jetmind2@gmail.com>
Authored: Thu May 9 08:55:57 2013 +0000
Committer: Cory Johns <cjohns@slashdotmedia.com>
Committed: Fri May 10 16:05:13 2013 +0000

----------------------------------------------------------------------
 ForgeGit/forgegit/model/git_repo.py |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-allura/blob/d65a4892/ForgeGit/forgegit/model/git_repo.py
----------------------------------------------------------------------
diff --git a/ForgeGit/forgegit/model/git_repo.py b/ForgeGit/forgegit/model/git_repo.py
index 2511ce0..e351cc5 100644
--- a/ForgeGit/forgegit/model/git_repo.py
+++ b/ForgeGit/forgegit/model/git_repo.py
@@ -332,7 +332,10 @@ class GitImplementation(M.RepositoryImplementation):
 
     def symbolics_for_commit(self, commit):
         branch_heads, tags = super(self.__class__, self).symbolics_for_commit(commit)
-        containing_branches = self._git.git.branch(contains=commit._id)
+        try:
+            containing_branches = self._git.git.branch(contains=commit._id)
+        except git.GitCommandError:
+            return []
         containing_branches = [br.strip(' *') for br in containing_branches.split('\n')]
         return containing_branches, tags
 


Mime
View raw message