You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@allura.apache.org by jo...@apache.org on 2013/05/10 18:05:46 UTC

[2/4] git commit: [#6222] ticket:349 Handle git errors gracefully in symbolics_for_commit

[#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 <je...@gmail.com>
Authored: Thu May 9 08:55:57 2013 +0000
Committer: Cory Johns <cj...@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